Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running MySQL from command line [closed]

Tags:

mysql

I have very recently installed MySQL using Zend Server in an effort to learn PHP and MySQL.

Installation went perfectly, however I installed it in my E: Drive as opposed to installing it in C drive. To launch it from the command line I am given to understand one must type, the following.

"C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld" -u root

or some variant. In my case, mysqld is in E:\Zend\MySQL55\bin.

However when I type in E:\Zend\MySQL55\bin\mysqld, the command line freezes and I can no longer enter anything. If I simply open the .exe file from the folder it's in, a command prompt window opens up and in the same sense freezes and I can't access it.

Is there another way to open it or is what I'm doing close but slightly wrong?

like image 224
Sood Avatar asked Jun 18 '13 15:06

Sood


People also ask

Why is my MySQL command line not opening?

1. Open Command prompt in admin and go to the location of Mysql bin folder and type - C:\ProgramFile\mysql\bin>mysql -u root -p <password> 2. Then the prompt asks for the password. This is the password or the root user which you had set during installation of mysql.

Why MySQL command line is closes after password?

It is because MySQL Server stop, may be you run another application that use the same port. Try to run MySQL Installer Community, and you will find the program that you have to reconfigure (blue text).

How do I start MySQL from command line?

Launch the MySQL Command-Line Client. To launch the client, enter the following command in a Command Prompt window: mysql -u root -p . The -p option is needed only if a root password is defined for MySQL. Enter the password when prompted.

How do I start MySQL after shutdown?

Restart MySQL Server on Windows First, open the Run window by using the Windows+R keyboard. Second, type services. msc and press Enter : Third, select the MySQL service and click the restart button.


2 Answers

For starting the server,

 C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld --console

To login, open a new command prompt window,

 C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql -u root

Then it will ask for password and you can enter

like image 70
Prasad Kharkar Avatar answered Nov 12 '22 23:11

Prasad Kharkar


In fact, mysqld is the server. If you want to launch the client you have to call mysql

C:\Program Files\MySQL\MySQL Server 5.0\bin\mysql -u root
like image 32
Gilles V. Avatar answered Nov 12 '22 22:11

Gilles V.