mysql8.0.20安装教程linux_mysql8.0.18安装配置⽅法图⽂教
程(linux)
本⽂记录了linux mysql 8.0.18 安装配置图⽂教程,供⼤家参考,具体内容如下
1、官⽹安装包下载地址
mysql下载之后是个文件夹2、我这⾥通过xftp将安装包上传⾄Linux服务器
3.解压
解压命令:tar -xvf mysql-8.0.18-linux-glibc2.12-x86_64.tar
继续解压需要的那⼀个
命令: tar -xvf mysql-8.0.18-linux-glibc2.12-x86_
重命名并移动到合适的路径
重命名 : mv mysql-8.0.18-linux-glibc2.12-x86_64 mysql 移动:
4.在/usr/local/mysql下创建data⽂件夹# mkdir data
5.初始化数据库,⾃动⽣成密码 需记录 等下要⽤
# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
ps:中间遇到⼀个坑,初始化数据库时候报了错
具体错误为:bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决⽅法为:yum install libaio-devel.x86_64 原因是缺少了libaio这个东西 安装就完事了
再次执⾏初始化命令
得到初始化密码,需要记下,⼀会会⽤到
6.修改/usr/local/mysql 当前⽬录的⽤户
# chown -R root:root ./
# chown -R mysql:mysql data
7.复制my-defaultf这个⽂件到etc/myf去
具体命令为:
# cd support-files/
# touch my-defaultf
# chmod 777 ./my-defaultf
# cd ../
# cp support-files/my-defaultf /etc/myf
8.完了之后配置myf
vim /etc/myf
内容:
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = /usr/local/mysql
datadir = /usr/local/mysql/data
socket = /tmp/mysql.sock
log-error = /usr/local/mysql/data/error.log
pid-file = /usr/local/mysql/data/mysql.pid
tmpdir = /tmp
port = 5186
#lower_case_table_names = 1
# server_id = .....
# socket = .....
#lower_case_table_names = 1
max_allowed_packet=32M
default-authentication-plugin = mysql_native_password
#lower_case_file_system = on
#lower_case_table_names = 1

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。