The following article describes how to correctly install the MySQL database in the linux operating system. First, we started by adding a MySQL database group and creating a MySQL database user, the following is the detailed description of the article.
1. Add a MySQL group and create a MySQL user
- groupadd MySQL
- useradd -g MySQL MySQL
2、decompress mysql-5.1.36.tar.gz
- tar -xzvf MySQL-5.1.36.tar.gz
3. Go to the decompressed directory and compile and install the package.
- cd MySQL-5.1.36
- ./configure --prefix=/usr/local/MySQL --with-charset=utf8 --with-extra-charsets=all --enable-assembler --enable-thread-safe-client --with-big-tables --with-readline --with-ssl --with-embedded-server --with-plugins=all
- make
- make install
4. Copy the configuration file
- cp support-files/my-large.cnf /etc/my.cnf
Update the owner and user group of the/usr/local/MySQL folder.
- cd /usr/local/MySQL/
- chown -R MySQL .
- chgrp -R MySQL .
4. Configure the services started with the server
- cp /home/MySQL-5.1.36/support-files/MySQL.server /etc/init.d/MySQLd
- chmod 755 /etc/init.d/MySQLd
- chkconfig --add MySQLd
7. initialize MySQL
- bin/MySQL_install_db --user=MySQL
8. Start MySQL
- bin/MySQLd_safe --user=MySQL
If the MySQL ended statement is not displayed, it indicates that the instance is successfully started.
9. Update the user's root password.
- /usr/local/MySQL/bin/MySQLadmin -u root password 123456
The above content is an introduction to the installation process of the MySQL database in linux. I hope you will have some gains.