Install mysqldata library in linux --tar.gzpackage decompress installation method, mysqltar.gz

Source: Internet
Author: User

Install mysqldata library in linux --tar.gzpackage decompress installation method, mysqltar.gz

There are multiple installation methods for the mysqldata library. This document only describes how to decompress the tar.gz package on the linux server,

Download mysql-5.7.3-m13-linux-glibc2.5-x86_64.tar.gz(suffixed with tar.gz compiled installation files) from the mysql official website or from network resources)
1. Create a mysql user # useradd mysql and set the permission to disable mysql logon to mysql # usermod-s/sbin/nologin mysql
2. Upload the downloaded tar.gz file to the server to be installed through xftp (or other tools)
3. Create a folder (mysqlService) in the # cd usr/local/directory # mkdir mysqlService
4. Return to the uploaded directory and move the tar.gz file to # cd usr/local/mysqlService.

# Cp-r mysql-5.7.3-m13-linux-glibc2.5-x86_64.tar.gz/usr/local/mysqlService/mysql-5.7.3-m13-linux-glibc2.5-x86_64.tar.gz
5. Unzip Command Format: tar-zxvf compressed file name .tar.gz # tar-zxvf apache-tomcat-7.0.64.tar.gz
6. Modify the file name [root @ int02 mysqlService] # mv mysql-5.7.3-m13-linux-glibc2.5-x86_64 mysql

7. Add a mysql group and a mysql user to set the owner and group of the mysql installation directory file.
[Root @ int02 mysqlService] # groupadd mysql
[Root @ int02 mysqlService] # useradd-r-g mysql

9. Enter the mysql folder, that is, the directory where mysql is located, and change the group and user.


10. [root @ int02 mysql] # chown-R mysql: mysql ./

Check whether the current directory is in the directory of the compiled and installed mysql program, and whether there is a scripts under this directory, and then check whether there is a file named mysql_install_db In the scripts/directory, is there any permission to execute this file?
[Root @ int02 mysql] #./scripts/mysql_install_db -- user = mysql

11. Change the owner of the files and directories in the current directory to the root user.
[Root @ int02 mysql] # chown-R root: root ./

Change the owner of the mysql_data folder to a mysql user.
[Root @ int02 mysql] # chown-R mysql: mysql data
Upload the configuration file to the/etc/init. d/directory.
[Root @ int02 mysql] # cp support-files/mysql. server/etc/init. d/mysql

Create a new log/mysqld. log directory under the installation directory

12. modify the configuration file [root @ int02 mysql] # vim/etc/my. cnf
[Client]
Default-character-set = utf8

[Mysqld]
Character-set-server = utf8
Datadir =/usr/local/mysqlService/mysql/data
Basedir =/usr/local/mysqlService/mysql
Socket =/tmp/mysql. sock

[Mysqld_safe]
Log-error =/usr/local/mysqlService/mysql/log/mysqld. log

13. Check whether the related file directories have sufficient permissions.
# Ll
If you do not have permission, grant permissions to the required documents.
# Chmod-R 755 mysqld. log
14. Start the mysql Service

[Root @ int02 mysql] # service mysql start
Stop mysql Service
[Root @ int02 mysql] # service mysql stop

15. View service processes
[Root @ int02 mysql] # ps-ef | grep mysql
View mysql logs
[Root @ int02 mysql] # vi log/mysqld. log

16. log on to the database
Password: znjt3edcxsw2! @
[Root @ int02 mysql # bin/mysql-u root-p

Exit
Mysql> quit;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.