Under Mac environment using terminal start Mysql, and mysql database connection

 

New to encounter a lot of pit mysql database, get most of the day and finally get to know some of the major record here in some way through the command-line operation.

 

First: the command line to start the database (under mac environment can open the database directly via the button)

sudo /usr/local/mysql/support-files/mysql.server start

 

Next is: connect mysql database through the command line

cd /usr/local/mysql/bin/
./mysql -uroot -padmin123

 root here and admin123 is the username and password mysql database, this step is very important, God is simply pit, I just wear my big half an hour to find the problem, so this step must not be forgotten. Do not want to write the user name and password also, you can skip this step by a command line, afraid of looking confused, these do not write an essay which I also have.

 

Two finish up above you can enter the mysql command-line mode, you can now create tables and a variety of CRUD operations

 

 

Guess you like

Origin www.cnblogs.com/lyd447113735/p/11512276.html