mysql understands the standard command-line options for specifying connection parameters. So to invoke mysql interactively from the command line, you have to specify any necessary connection parameters after the command name like mysql –user=user_name –password=password –host=host_name.

Take example:

shell> mysql --user=root --password=root --host=localhost

You can also use short forms:

shell> mysql -u root -proot -h localhost

You can also ask mysql providing a database name to select that database as the default database:

shell> mysql -u user_name -p -h host_name db_name

On Windows, you can do like this:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql  -u user_name -p -h host_name db_name

Posted in: MySQL

Related FAQ's

Marius Ion ANGEL HOT SOFT LLC (800) 316-7677