How start with MYSQL in macOS
Working with MYSQL using mac ox .
Here I am going to discuss all the steps how to install and run MYSQL database in mac ox. Then how to start the database server using terminal and manually . I will discuss the problem running the server and login root user in mac ox . This document
make easy for those who use this database first time in mac .
STEP 1 ) Download latest version of MYSQL Database . Current version 8.0 dmg file from internet . Then install it . Keep your user default user root and choose default
Port number 3306
STEP 2 ) There are two way to start the server one is manually another way through
terminal using command .
1) First start mysql server manually .
a) Go to system preferences then mysql you will this
You can start the server clicking start server . This will asked you
system password . Enter your system login password. This will start
server .
2) Through terminal we can do it also . Go Utilities -> terminal . Type
these command.
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server start
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server stop
Restart MySQL
sudo /usr/local/mysql/support-files/mysql.server restart
While using these command you may get restarting problem sometimes .
$ sudo /usr/local/mysql/support-files/mysql.server restart
ERROR! MySQL server PID file could not be found!
ERROR! MySQL server PID file could not be found!
Then you need to kill all running db process.
$ sudo killall mysqld
then run restart the server
$ sudo /usr/local/mysql/support-files/mysql.server restart
you will get this message ..
Starting MySQL
.. SUCCESS!
.. SUCCESS!
You can now log the root user. Entering password. Root user is default user of the
Mysql . There are some default tables are available . You can create your own database
And tables.
Some times in mac if you are running command in bash . You get
Error message if you run mysql command first time .
mysql command not found.
This is due to path properly not set for mysql . You need to resolve this you need to
To do so follow these steps: 1. Open a new Terminal window or make sure you are in the home directory 2. Open .bash_profile using
nano .bash_profile
3. Add the following command to add the mysql path
PATH="/usr/local/mysql/bin:${PATH}"
export PATH
4. Press Ctrl+X, then press y and press enter.
To do so follow these steps: 1. Open a new Terminal window or make sure you are in the home directory 2. Open .bash_profile using
nano .bash_profile
3. Add the following command to add the mysql path
PATH="/usr/local/mysql/bin:${PATH}"
export PATH
4. Press Ctrl+X, then press y and press enter.
Finally run . You log root user typing
$ mysql -u root - p
then enter password .
Enjoy !!!!!!!
How start with MYSQL in macOS
Reviewed by Mukesh Jha
on
10:20 PM
Rating:

No comments:
Add your comment