mysql
in Batch Mode
To connect to the server, you'll usually need to provide a MySQL
user name when you invoke mysql
and, most likely, a password. If the
server runs on a machine other than the one where you log in, you'll also
need to specify a hostname. Contact your administrator to find out what
connection parameters you should use to connect (that is, what host, user name,
and password to use). Once you know the proper parameters, you should be
able to connect like this:
shell> mysql -h host -u user -p Enter password: ********
The ********
represents your password; enter it when mysql
displays the Enter password:
prompt.
If that works, you should see some introductory information followed by a
mysql>
prompt:
shell> mysql -h host -u user -p Enter password: ******** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 459 to server version: 3.22.20a-log Type 'help' for help. mysql>
The prompt tells you that mysql
is ready for you to enter commands.
Some MySQL installations allow users to connect as the anonymous
(unnamed) user to the server running on the local host. If this is the case
on your machine, you should be able to connect to that server by invoking
mysql
without any options:
shell> mysql
After you have connected successfully, you can disconnect any time by typing
QUIT
(or \q
) at the mysql>
prompt:
mysql> QUIT Bye
On Unix, you can also disconnect by pressing Control-D.
Most examples in the following sections assume you are connected to the
server. They indicate this by the mysql>
prompt.
Posted by Rizwan Omer on Sunday April 13 2003, @12:53am | [Delete] [Edit] |
What is the user name and password for MySQL ADMINISTROATOR?
Posted by Catharina Hogarth on Wednesday April 16 2003, @12:46am | [Delete] [Edit] |
I was having problems with this and kept geting that mysql was not recognized as a command but finally figured that if I go to the directory where mysql is installed and type bin\ before the command that it works to get the password prompt:
bin\mysql -h localhost -u root -p
Hope this helps,
Catharina
ps: running on w2k/iis5
Posted by Karsten on Saturday April 19 2003, @9:54am | [Delete] [Edit] |
Just put the MySQL bin dir into the path and it should be accessible.
Posted by Sunil George on Friday April 25 2003, @12:59am | [Delete] [Edit] |
Dear Rizwan try username: root password blank
Posted by San MN on Saturday May 3 2003, @4:19am | [Delete] [Edit] |
Rizwan, by this time u might have got what u want!
some more to add,
Check where the executable/shell/perl script files are stored and give the respective path.eg.(definitely@)
>/usr/bin/mysql -h host-name -u root -p
Happy administration!
Posted by Rizwan Omer on Thursday July 10 2003, @2:54am | [Delete] [Edit] |
Thanks everyone for their suggestion
I figured out that when MySQL is newly installed on a system and no User is created then in that case, we can use the Default Administrator account to logon to the MySQL. We can logon to MySQL by entering the following command at the Command Prompt:
>mysql -u root -p
in the above line "root" is the username for the deafult Admin account. When it ask for the Password. Simply press ENTER (Blank Password).
After that you will be able to see the MySQL Prompt, which looks like:
mysql>
After you get this prompt you can create new user. Keep in mind we can create regular users as well as Users with FULL (Admin) rights.
Hope it helps!!!