leestretton.com

You are in: > Home > Developers Guides

MySQL - Connecting to the server

MySQL Logo

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>

Problem with this page? Let us know
© Lee Stretton 2005 | powered by linux powered by php 5 powered by MySQL download rss feeds powered by php 5 valid css