Thursday, January 15, 2009

Starting the mysql command

To get started creating databases and tables, you can use the mysql command. From any Terminal window, open the mysql database on your computer by typing the following:
# mysql −u root −p mysql
Enter password: *********

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with −A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 39 to server version: 3.23.36
Type 'help;' or '\h' for help. Type '\c' to clear the buffer
mysql>
Type in the root user's MySQL password as prompted. The mysql> prompt appears, ready to accept commands for working with the mysql default database on the localhost. If you are connecting to the MySQL server from another host computer, add a −h hostname to the command line (where hostname is the name or IP address of the computer on which the MySQL server is running). Remember, you can also login as any valid mysql login you created, regardless of which Linux login account you are currently logged in under. As the mysql text notes above, be sure to end each command that you type with a semi−colon (;) or a \g. If you type a command and it appears to be waiting for more input, it's probably because you forgot to put a semi−colon at the end.

No comments:

Post a Comment