INSTALL MYSQL db STEPS
https://downloads.mysql.com/archives/community/
mkdir /usr/local/mysq
mkdir /home/data
groupadd mysql
useradd -r -s /sbin/nologin -g mysql mysql -d /usr/local/mysql
cd /usr/local/mysql
#pwd
#chown -R mysql .
#chgrp -R mysql .
chown -R mysql /home/data/mysql
# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/data/mysql
[root@TEST01104 mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/home/data/mysql
2021-03-29T09:09:40.726431Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-03-29T09:09:51.552708Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-03-29T09:09:53.091280Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-03-29T09:09:53.227368Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 85e7777d-906e-11eb-8282-0050569f07a4.
2021-03-29T09:09:53.241973Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-03-29T09:09:53.242937Z 1 [Note] A temporary password is generated for root@localhost: MsT)%<&=;6zW
temppassword:MsT)%<&=;6zW
MsT)%<&=;6zW
#bin/mysql_ssl_rsa_setup --datadir=/home/data/mysql
[root@TEST01104 mysql]# bin/mysql_ssl_rsa_setup --datadir=/home/data/mysql
Generating a 2048 bit RSA private key
...........................................+++
...........................................+++
writing new private key to 'ca-key.pem'
-----
Generating a 2048 bit RSA private key
.....+++
.........................................................+++
writing new private key to 'server-key.pem'
-----
Generating a 2048 bit RSA private key
..+++
..........+++
writing new private key to 'client-key.pem'
-----
cd support-files
ls -lrt /etc/my.cnf
ls -lrt /etc/init.d/mysql
cp /etc/my.cnf /etc/my.cnf.20210329
cp /etc/init.d/mysql /etc/init.d/mysql.20210329
# cp my-default.cnf /etc/my.cnf
# cp mysql.server /etc/init.d/mysql
vim /etc/init.d/mysql
Basedir=/usr/local/mysql
Datadir=/home/data/mysql
# vim /etc/my.cnf
vi /etc/my.cnf
port=3306
socket=/usr/local/mysql/mysql.sock
[mysql]
no-auto-rehash
socket=/usr/local/mysql/mysql.sock
basedir=/usr/local/mysql
max_allowed_packet=32M
datadir=/home/data/mysql
explicit_defaults_for_timestamp =true
skip-ssl
#secure-file-priv=null
#lower_case_table_names=1
back_log=300
max_connections=3000
max_connect_errors=100
table_open_cache=4096
external_locking=FALSE
max_allowed_packet=32M
sort_buffer_size=16M
join_buffer_size=16M
thread_cache_size=16
query_cache_size=128M
query_cach_limit=4M
character-set-server = utf8mb4
启动mysql:
cd /usr/local/mysql
#bin/mysqld_safe --user=mysql &
bin/mysql --user=root –p
/usr/local/mysql/bin/mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
fix:
ln -s /usr/local/mysql/mysql.sock /tmp/mysql.sock
set password=password('A123456');
root A123456
grant all privileges on *.* to root@'%' identified by 'A123456';
##restart mysql
sudo /etc/init.d/mysql restart
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!