时间:2021-07-01 10:21:17 帮助过:7人阅读
12、配置my.cnf
vi /etc/my.cnf
[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
log_bin_trust_function_creators = ON
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
如果后期mysql运行报错,可以直接到log-error = /usr/local/mysql/data/error.log目录下直接查看错误日志
命令:cat /usr/local/mysql/data/error.log
13、开机自启,进入/usr/local/mysql/support-files进行设置
cd support-files/
cp mysql.server /etc/init.d/mysql
chmod +x /etc/init.d/mysql
14、注册服务
chkconfig --add mysql
15、查看是否成功
chkconfig --list mysql
16、etc/ld.so.conf要配置路径,不然报错
vi /etc/ld.so.conf
添加内容/usr/
local
/mysql/lib
17、配置环境变量
vm /etc/profile
添加如下内容
#MYSQL ENVIRONMENT
export PATH=$PATH:/usr/local/mysql/bin:/usr/local/mysql/lib
source /etc/profile
18、登录 需要用到上面的生成的密码
service mysql start
mysql -u root -p
ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘root‘;
完成
Linus安装mysql8
标签:当前目录 blank names table ogg ons get 压缩 linux服务器