You are in: > Home > Developers Guides
MySQL - Connecting to the server

Any session starts by connecting to the MySQL server. For API's which require a servername, use localhost.
The example below shows you how to connect to the server from a unix shell (over an SSH connection).
# mysql -u username -p Enter password: ******
Replace username with the MySQL user and ****** with the password created for your hosting account.
To connect to a remote mysql server you would do the following:
# mysql -h hostname -u username -p Enter password: ******
Replace hostname with the FQDN or IP address of the remote host, username with the MySQL user and ****** with the password created for your hosting account.
When you have connected to the MySQL server you should see something like the following
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 57 to server version: 4.0.24_Debian-10ubuntu2-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>
Related articles
- Perl - Downloading a URL with a script - [22nd Mar 2006]
- Perl - Pattern Matching (Regular Expressions) - [12th Jan 2006]
- Shell Scripting - Reading Variables From STDIN - [11th Jan 2006]
- Perl - Configuring and Starting the mod_perl Server - [06th Jan 2006]
- Perl - Installing mod_perl in Three Steps - [06th Jan 2006]
- Perl - mod_perl - [06th Jan 2006]
- Perl - Associative Arrays - [06th Jan 2006]
- Perl - Manipulating Arrays - [06th Jan 2006]
- Perl - Arrays - [06th Jan 2006]
- Perl - Operators - [06th Jan 2006]
- Perl - Scalar Variables - [06th Jan 2006]
- Shell Scripting - Introduction - [08th Dec 2005]
- Shell Scripting - Invoking Shell Scripts - [08th Dec 2005]
- Shell Scripting - Variables - [08th Dec 2005]
- Shell Scripting - Referencing Variables - [08th Dec 2005]
- Shell Scripting - Command Arguments - [08th Dec 2005]
- Shell Scripting - Language Constructs - [08th Dec 2005]
- Perl - Introduction - [06th Dec 2005]
- MySQL - Connecting to the server - [06th Dec 2005]
- MySQL - Introduction - [06th Dec 2005]







