Mysql5.7.18
rpm -qa|grep mariadb // Query the installed mariadb
rpm -e --nodeps file name // Uninstall mariadb, the file name is the file queried by the above command
yum -y install gcc gcc-c++ ncurses ncurses-devel cmake bison
5.7/5.7 decompress and rename
chmod -R 755 mysql/
chown -R lbd.lbd mysql/
The lbd user has been created by default, some people like to use the mysql user
rm /etc/my.cnf
mkdir –p /usr/local/mysql/data
mkdir –p /var/lib/mysql/
bin/mysqld –initialize --user=lbd basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
haoglu1Gw6;c different passwords
bin/mysql_ssl_rsa_setup --datadir=/usr/local/mysql/data
vim /etc/my.cnf
[mysql]
Set the mysql client default character set
default-character-set=utf8
[mysqld]
skip-name-resolve #Set
3306 port
port = 3306
Set the installation directory of mysql
basedir=/usr/local/mysql
Set the storage directory of the data of the mysql database
datadir=/usr/local/mysql/data
Maximum number of connections allowed
max_connections=200
The character set used by the server defaults to the 8-bit encoded latin1 character set
character-set-server=utf8
The default storage engine that will be used when creating new tables
default-storage-engine=INNODB
max_allowed_packet=16M
cp support-files/mysql.server /etc/init.d/mysqld
vim /etc/init.d/mysqld
basedir=/usr/local/mysql
datadir=/usr/local/mysql/bin
屏蔽
#lockdir='/var/lock/subsys'
#lock_file_path="$lockdir/mysql"
cd /usr/local
chown -R lbd.lbd mysql/
service mysqld start
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
chkconfig --add mysqld #Add mysqld service
chkconfig --list #Column Out all system services
chkconfig --level 35 mysqld on #Set
mysqld to run the service at level 3 and 5 for booting
mysql -u root -p
before the password
SET PASSWORD = PASSWORD('lbd123'); reset the password
grant all privileges on . to 'root'@'%' identified by 'lbd123';
FLUSH PRIVILEGES;