Installation mysql mysql installation under the CentOS centos

Under CentOS install mysql

  Try to deploy web applications on Tencent cloud server, set up to think first about the server environment, the operating system chosen is centos7, the installed jdk, tomcat after the test can deploy web applications ready to install a mysql database, I tried before are several ways to end the initial password can not be found, this time again Baidu installation.

  It is said that there is no centos7 yum source mysql, so he downloaded repo source mysql directly from the Internet (this stuff is currently not look very carefully is something which should be in centos involved), use

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 

 

Download the rpm package from the Internet (here wget command to download files from the network's general command format wget + url), Once you have downloaded the rpm package to install this package

 rpm -ivh mysql-community-release-el7-5.noarch.rpm

After installing the rpm package to begin installation mysql-server 

sudo yum install mysql-server

After that download and install the network, where there will need to select two in the middle are filled "y" carriage return on the line, then it will display the installation was successful

Then we have to test whether the installation is successful, then the windows as if the same direct input mysql -uroot -p may be some error (ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/ var / lib / mysql / mysql.sock '(2)) because the file permission issues mysql, the need to change the file permissions of the current user

 sudo chown -R openscanner:openscanner /var/lib/mysql

And then restart the service to re-direct the root user login 

service mysqld restart
mysql -u root 

This will enter the mysql service, which is our common mysql command line, then you should modify the root user password

use mysql;
update user set password=password('new password') where user='root'; flush privileges;

Here is a selection of the first sentence of the need to modify the database, username and password in mysql database called mysql in this library before modifying data in the database tables need to use the command to select which database, second sentence user data table is updated in the root user's password to a new password, the third sentence is to modify the front made to refresh the effect on the system.

You can then use the exit command to exit and re-use mysql -uroot -p Enter then enter the new password to enter the mysql.

  Summary: Here centos installation mysql mysql under windows and there is a difference, install mysql There are several ways the windows, download installation package that is fool-mounted directly to the next step on the line, the use of free installation version is the official website Download archive decompression, and then modify the default configuration file my.ini default.ini modify the contents of the file directory and data about the bin directory of the file and when the need to modify the encoding utf-8 added support when support Chinese, and then initialize mysqld service, after starting the mysql service can log into the root user (the default password after installing a generated file), change the password to log statements are the same. There may be more difference is caused due to differences in system.

  Try to deploy web applications on Tencent cloud server, set up to think first about the server environment, the operating system chosen is centos7, the installed jdk, tomcat after the test can deploy web applications ready to install a mysql database, I tried before are several ways to end the initial password can not be found, this time again Baidu installation.

  It is said that there is no centos7 yum source mysql, so he downloaded repo source mysql directly from the Internet (this stuff is currently not look very carefully is something which should be in centos involved), use

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 

 

Download the rpm package from the Internet (here wget command to download files from the network's general command format wget + url), Once you have downloaded the rpm package to install this package

 rpm -ivh mysql-community-release-el7-5.noarch.rpm

After installing the rpm package to begin installation mysql-server 

sudo yum install mysql-server

After that download and install the network, where there will need to select two in the middle are filled "y" carriage return on the line, then it will display the installation was successful

Then we have to test whether the installation is successful, then the windows as if the same direct input mysql -uroot -p may be some error (ERROR 2002 (HY000): Can not connect to local MySQL server through socket '/ var / lib / mysql / mysql.sock '(2)) because the file permission issues mysql, the need to change the file permissions of the current user

 sudo chown -R openscanner:openscanner /var/lib/mysql

And then restart the service to re-direct the root user login 

service mysqld restart
mysql -u root 

This will enter the mysql service, which is our common mysql command line, then you should modify the root user password

use mysql;
update user set password=password('new password') where user='root'; flush privileges;

Here is a selection of the first sentence of the need to modify the database, username and password in mysql database called mysql in this library before modifying data in the database tables need to use the command to select which database, second sentence user data table is updated in the root user's password to a new password, the third sentence is to modify the front made to refresh the effect on the system.

You can then use the exit command to exit and re-use mysql -uroot -p Enter then enter the new password to enter the mysql.

  Summary: Here centos installation mysql mysql under windows and there is a difference, install mysql There are several ways the windows, download installation package that is fool-mounted directly to the next step on the line, the use of free installation version is the official website Download archive decompression, and then modify the default configuration file my.ini default.ini modify the contents of the file directory and data about the bin directory of the file and when the need to modify the encoding utf-8 added support when support Chinese, and then initialize mysqld service, after starting the mysql service can log into the root user (the default password after installing a generated file), change the password to log statements are the same. There may be more difference is caused due to differences in system.

Guess you like

Origin www.cnblogs.com/duanlinxiao/p/10936347.html