Install mysql in linux
1. mysql tar file download:
Https://dev.mysql.com/downloads/mysql/5.6.html#downloads
2. Enter the directory where the installation package is located
Run the following command:tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz
3. Copy the decompressed mysql directory to the local Software Directory of the system:
Run the following command:cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r
4. Add the mysql group and mysql users:
Run the following command:Groupadd mysql and useradd-r-g mysql
5. Install the database:
Go to the mysql installation directory and run the following command:cd /usr/local/mysql
Modify the current directory owner as a mysql user: Execute the commandchown -R mysql:mysql ./
Install the database: Execute the command ./scripts/mysql_install_db --user=mysql
Modify the current directory owner as root user: Execute the commandchown -R root:root ./
Modify the current data directory owner as a mysql user: Execute the commandchown -R mysql:mysql data
6. Start the mysql service and add and start the mysql service:
Add boot start: Execute the commandcp support-files/mysql.server /etc/init.d/mysql
, Put the startup script in the boot initialization directory
Start mysql service: execute commandsservice mysql start
Run the following command:ps -ef|grep mysql
The mysql service is successfully started.
7. Modify the mysql root User password. If the root initial password is empty:
Run the following command:./Bin/mysqladmin-u root password 'Password'
8. Place the mysql client in the default path:
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
Note: We recommend that you use soft links instead of directly copying package files to facilitate system installation of multiple versions of mysql.
Summary
The above section describes how to install mysql in linux. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!