Small knowledge, big challenge! This article is participating in the creation activity of “Essential Tips for Programmers”.

preface

I remember that the author started to get in touch with Linux system seriously 7 years ago. Now, except for testing and a small part of development, he has been competent as a junior and intermediate operation and maintenance engineer. Although this capability is not high, compared to most current working environments on Linux server, it can be used easily, such as deploying services, writing shell scripts, assisting performance testing, etc.

This article is also an early record of learning Linux, always believe that the level of skill, only the hand is familiar.

Select Platform: Select linux-generic, and drag the mysql installation package to the bottom. Linux – Generic (glibc 2.5) (x86, 32-bit)

2. Decompress the 64-bit mysql binary installation file tar -xvf mysql-5.5.52-linux2.6-x86_64.tar.gz.

3. Copy the decompressed mysql directory to the local software directory of the system

Run cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r

Note: do not end the directory with a slash

4. Add the mysql group and mysql user. Run groupadd mysql and useradd -r -g mysql mysql

5. Install the database

To access the mysql installation directory, run the CD /usr/local/mysql command

To change the current directory owner to a mysql user, run the chown -r mysql:mysql./ command

To install the database, run./scripts/mysql_install_db –user=mysql

To change the owner of the current directory to user root, run chown -r root:root./

To change the owner of the current data directory to a mysql user, run the chown -r mysql:mysql data command

This database is installed

Mysql > start mysql server

Add startup: Run cp supper-files /mysql.server /etc/init.d/mysql to save the startup script in the startup initialization directory

To start the mysql service, run service mysql start

Execute the command: ps – ef | grep mysql see the mysql service description started successfully, as shown in figure

/bin/mysqladmin -u root password ‘password’

8, put the mysql client default path: ln -s/usr/local/mysql/bin/mysql/usr/local/bin/mysql

Note: It is recommended to use a soft link, not directly copy the package file, so that the system can install multiple versions of mysql

MySQL > remote access linux-mysql database

mysql>grant all privileges on*. *to root@"%" identified by "root"; Mysql > alter databaseFLUSH PRIVILEGES;
Copy the code