CentOS安装mysql
时间:2021-07-01 10:21:17
帮助过:32人阅读
4)编辑mysql配置文件
vi /etc/my.cnf
[mysqld]
basedir=/usr/local/mysql
datadir =/usr/local/mysql/data
port=3306
max_connections=400
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
lower_case_table_names=1
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
federated
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
user=mysql
tmpdir=/tmp
log-error=/usr/local/mysql/data/error.log
pid-file=/usr/local/mysql/data/mysql.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
5)测试mysql服务
/usr/local/mysql/support-files/mysql.server start
6)创建mysql 软连接
[root@localhost /]# ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
[root@localhost /]# ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
[root@localhost /]# service mysql restart
7)登录mysql,修改密码(密码为上面生成的临时密码)
8)登录mysql数据库 修改密码
mysql -u root -p
Enter password:
SET PASSWORD = PASSWORD(‘root‘);
9)修改mysql登录用户
use mysql;
update user set host=‘%‘ where user = ‘root‘;
flush privileges;
常见问题:
(1)yum -y install numactl
CentOS安装mysql
标签:mysql数据库 update youdao 解压 direct -o linu end set