bindiego
9/18/2014 - 1:52 AM

mysql setup

mysql setup

When the installation is complete, we need to run some additional commands to get our MySQL environment set up securely.

First, we need to tell MySQL to create its database directory structure where it will store its information. You can do this by typing:

> sudo mysql_install_db

Afterwards, we want to run a simple security script that will remove some dangerous defaults and lock down access to our database system a little bit. Start the interactive script by running:

> sudo mysql_secure_installation

You will be asked to enter the password you set for the MySQL root account. Next, it will ask you if you want to change that password. If you are happy with your current password, type "n" for "no" at the prompt.

For the rest of the questions, you should simply hit the "ENTER" key through each prompt to accept the default values. This will remove some sample users and databases, disable remote root logins, and load these new rules so that MySQL immediately respects the changes we have made.

At this point, your database system is now set up and we can move on.

------------ Ubuntu config ----------------
conf: /etc/mysql/my.cnf
init: /etc/init/mysql.conf
GRANT ALL PRIVILEGES ON *.* TO 'mysqluser'@'192.168.0.113' IDENTIFIED BY 'liwenbianji';

FLUSH PRIVILEGES;