Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps to install mysql5.7.16 for ordinary binaries

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains the "ordinary binary file installation steps of mysql5.7.16", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "ordinary binary file installation mysql5.7.16 steps" bar!

1. Installation environment:

Centos6.5 x64

two。 Installation process 2.1 preparation process:

Install the following rpm:

Yum list | grep libaio # install all packages

2.2 actual installation steps:

Groupadd mysql

Useradd-r-g mysql-s / bin/false mysql

Cd / usr/local

Tar zxvf ~ / mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz

Ln-s mysql-5.7.16-linux-glibc2.5-x86_64 mysql

Cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysqld # config auto start service,optional

Cd / usr/local/mysql

Mkdir / usr/local/mysql/mysql-files

Chmod 750 mysql-files

Chown-R mysql.

Chgrp-R mysql.

Echo 'export PATH=$PATH:/usr/local/mysql/bin' > > ~ / .bash_profile

Source / .bash_profile

Bin/mysqld-- initialize-- user=mysql # MySQL 5.7.6 and up,-No data directory was generated

Bin/mysqld-- initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data #-- ylrK.eaproprio3os

Bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and up

Chown-R root.

Chown-R mysql data mysql-files

Bin/mysqld_safe-- user=mysql & # start the database

3. Error reporting and resolution

#-error 1: mysql automatically reports error

#

2016-12-11T12:35:54.907157Z mysqld_safe Logging to'/ var/log/mysqld.log'.

2016-12-11T12:35:54.972890Z mysqld_safe Starting mysqld daemon with databases from / var/lib/mysql

2016-12-11T12:35:55.381863Z mysqld_safe mysqld from pid file / var/run/mysqld/mysqld.pid ended

# #-/ var/log/mysqld.log

2016-12-11T12:35:55.369838Z 0 [ERROR] / usr/local/mysql/bin/mysqld: Cant create/write to file'/ var/run/mysqld/mysqld.pid' (Errcode: 2-No such file or directory)

2016-12-11T12:35:55.369865Z 0 [ERROR] Can't start server: can't create PID file: No such file or directory

2016-12-11T12:35:55.381863Z mysqld_safe mysqld from pid file / var/run/mysqld/mysqld.pid ended

# solution 1

Mkdir / var/run/mysqld/

Cd / var/run/

Chown-R mysql.mysql mysqld

Mysqld_safe-- user=mysql &

# solve the problem

#

#-error 2 is as follows

#

/ etc/init.d/mysqld status

ERROR! MySQL is running but PID file could not be found

# solution 1

# restart

Kill-9

/ etc/init.d/mysqld start

# solve the problem

#

#-error 3: initial login error

#

# mysql-uroot-p

Enter password:

ERROR 2002 (HY000): Cant connect to local MySQL server through socket'/ tmp/mysql.sock' (2)

# solution 1

# change the configuration file / etc/my.cnf as follows:

Socket=/var/lib/mysql/mysql.sock-- > socket=/tmp/mysql.sock

# unresolved issues

# solution 2

On the basis of solution 1:

Stop mysql: kill-9

Run mysqld_safe-- skip-grant-tables &

If you don't want to be connected remotely at this time: mysqld_safe-- skip-grant-tables-- skip-networking &

Connect server:mysql-uroot-p using mysql

Change the password: update mysql.user set authentication_string=password ('123qwe') where user='root' and Host =' localhost'

* A special reminder is that there is no Password field in the user table under the new version of mysql database.

Instead, the encrypted user password is stored in the authentication_string field

Mysql > flush privileges

Mysql > quit

The modification is complete. Restart

Killall-TERM mysqld.

Mysqld_safe &

# solve the problem

#

Thank you for your reading, the above is the "ordinary binary installation of mysql5.7.16 steps" content, after the study of this article, I believe you have a deeper understanding of the ordinary binary installation of mysql5.7.16 steps, the specific use of the need for you to practice verification. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report