mysql 安装
解压文件
tar -zvxf mysql-8.0.19-el7-x86_64.tar.gz # 重命名后放在 /opt/software/mysql 下 mkdir data etc log touch etc/my.ini
编辑配置文件 my.ini
[mysqld] # 设置3306端口 port=3306 # 设置mysql的安装目录 basedir=/opt/software/mysql # 设置mysql数据库的数据的存放目录 datadir=/opt/software/mysql/data # 允许最大连接数 max_connections=200 # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 max_connect_errors=10 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB # 默认使用“mysql_native_password”插件认证 default_authentication_plugin=mysql_native_password [mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 # pid pid-file=/opt/software/mysql/mysql.pid # socket socket=/opt/software/mysql/mysql.socket # logerr log-error=/opt/software/mysql/log/mysql.log [client] # 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8
初始化
bin/mysqld --initialize --datadir=/opt/software/mysql/data/
启动
nohup bin/mysqld_safe --defaults-file=/opt/software/mysql/etc/my.ini &
重置mysql-root密码
alter user ‘root‘@‘localhost‘ identified by "root"; create user ‘%‘ identified by ‘root‘; grant all privileges on *.* to ‘%‘; flush privileges; # 创建数据库 CREATE DATABASE IF NOT EXISTS ifan DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_chinese_ci; # 创建用户 CREATE USER ‘ifan‘@‘%‘ IDENTIFIED BY ‘ifan‘; GRANT all privileges ON database.table TO ‘ifan‘@‘%‘; flush privileges
相关推荐
CoderToy 2020-11-16
bianruifeng 2020-11-16
云中舞步 2020-11-12
敏敏张 2020-11-11
暗夜之城 2020-11-11
好记忆也需烂 2020-11-11
Coder技术文摘 2020-09-29
huacuilaifa 2020-10-29
Gexrior 2020-10-22
lpfvip00 2020-10-07
云中舞步 2020-09-11
康慧欣 2020-09-10
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13