【服務(wù)與運維】2.0 centos7安裝mysql——源碼:cmake安裝mysql

https://typecodes.com/web/centos7compilemysql.html
https://typecodes.com/web/solvemysqlcompileerror.html
以下內(nèi)容凡是執(zhí)行過程中找不到某個文件的,手動新建該文件即可。直到不報錯為止。
刪除mariadb

rpm -qa | grep mariadb

rpm -e --nodeps mariadb-connector-c-config-3.0.7-1.el8.noarch

rpm -e --nodeps mariadb-connector-c-3.0.7-1.el8.x86_64

cd /data/company/company_software/

xshell傳輸文件的指令

zy -y

1.0 rpm安裝方式(棄用):

rpm -ivh MySQL_*

2.0 cmake方式安裝mysql(企業(yè)級使用)
下載cmake

[root@www company_software]# wget https://github.com/Kitware/CMake/releases/download/v3.17.1/cmake-3.17.1.tar.gz
[root@www company_software]# wget https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2.tar.gz
[root@www company_software]# wget https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1.tar.gz

安裝cmake

[root@www company_software]# ll
image.png
[root@www company_software]# tar -zxvf cmake-3.20.1.tar.gz 
[root@www company_software]# cd cmake-3.20.1/
[root@www cmake-3.20.1]# ./configure
image.png
[root@www cmake-3.20.1]# gmake
image.png
[root@www cmake-3.20.1]# gmake install
image.png

安裝依賴包

#######Ncurses:提供功能鍵定義(快捷鍵),屏幕繪制以及基于文本終端的圖形互動功能的動態(tài)庫。
#######bison:GNU分析器生成器tat
#######Boost庫:一個開源可移植的C++庫,是C++標(biāo)準(zhǔn)化進程的開發(fā)引擎之一
yum install -y git gcc gcc-c++ ncurses-devel bison
######下載gmock:google的c++mock框架,從mysql 5.6開始支持
yum install gmock
[root@isso mysql-5.7.29]# yum install openssl*

下載安裝boost1.59.0(這里mysql5.7版本要求boost版本為1.59.0)

wget https://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz

解壓(未使用)

[root@isso ttwis_software]# tar xf boost_1_59_0.tar.gz 
[root@isso ttwis_software]# cd boost_1_59_0/
[root@isso boost_1_59_0]# ./bootstrap.sh --prefix=/usr/local/boost
image.png
[root@isso boost_1_59_0]# ./b2  stage threading=multi link=shared  install --prefix=/usr/local/boost
image.png

設(shè)置組合用戶

groupadd mysql
useradd -g mysql -m  mysql

下載新的 CentOS-Base.repo 到 /etc/yum.repos.d/,換阿里云源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

運行 yum makecache 生成緩存

解壓mysql二進制包

wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.30.tar.gz
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.34.tar.gz

[root@www company_software]# tar zxf mysql-5.7.30.tar.gz 
[root@www company_software]# tar zxf mysql-5.7.34.tar.gz 
  cd mysql-5.7.30
cd mysql-5.7.34/

直接把解壓后的boost放入mysql解壓目錄下

cp -r ../boost_1_59_0 ./boost

image.png

命令安裝

cmake . -DCMAKE_INSTALL_PREFIX=/data/company/company_program/mysql-5.7.34 \
-DMYSQL_DATADIR=/data/company/company_program/mysql-5.7.34/data \
-DMYSQL_UNIX_ADDR=/data/company/company_program/mysql-5.7.34/tmp/mysql.sock \
-DSYSCONFDIR=/etc \
-DMYSQL_USER=mysql \
-DMYSQL_TCP_PORT=3306 \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DENABLE_DOWNLOADS=1 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_FEDERATED_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
-DWITHOUT_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FAST_MUTEXES=1 \
-DWITH_ZLIB=bundled \
-DWITH_BOOST=./boost \
-DWITH_SSL:STRING=system \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_EMBEDDED_SERVER=1 \
-DMYSQL_MAINTAINER_MODE=0 \
-DWITH_DEBUG=0

-DDOWNLOAD_BOOST=1
-DWITH_BOOST=./boost \

DYMSQL_UNIX_ADDR sock路徑
DDEFAULT_CHARSET默認字符集
DDEFAULT_COLLATION默認的校對規(guī)則
DEXTRA_CHARSETS支持的額外的字符集
DENABLED_LOCAL_INFILE打開LOCAL_INFILE功能
-DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 -DWITHOUT_PARTITION_STORAGE_ENGINE=1 支持各種引擎

看到如下畫面表示mysql編譯成功:


image.png
make && make install

安裝完成界面:


圖片.png

使用命令查看編譯成功后的mysql安裝目錄

[root@www mysql-5.7.34]# ls -lrt /data/company/company_program/mysql-5.7.34/
total 296
-rw-r--r--  1 root root    587 Dec 18 20:59 README-test
-rw-r--r--  1 root root    587 Dec 18 20:59 README
-rw-r--r--  1 root root 276202 Dec 18 20:59 LICENSE
drwxr-xr-x  2 root root      6 Apr 23 18:38 logs
drwxr-xr-x  2 root root      6 Apr 24 17:20 data
drwxr-xr-x  2 root root      6 Apr 24 17:23 tmp
drwxr-xr-x  2 root root     55 Apr 25 12:27 docs
drwxr-xr-x  3 root root   4096 Apr 25 12:27 include
drwxr-xr-x  4 root root     30 Apr 25 12:27 man
drwxr-xr-x  4 root root    192 Apr 25 12:27 lib
drwxr-xr-x  2 root root   4096 Apr 25 12:27 bin
drwxr-xr-x 10 root root   4096 Apr 25 12:28 mysql-test
drwxr-xr-x 28 root root   4096 Apr 25 12:28 share
drwxr-xr-x  2 root root     90 Apr 25 12:28 support-files
[root@www mysql-5.7.34]# ls -lrt /data/company/company_program/mysql-5.7.34/lib/
total 547356
-rwxr-xr-x 1 root root   6833256 Apr 25 11:16 libmysqlclient.so.20.3.16
-rw-r--r-- 1 root root  13705968 Apr 25 11:16 libmysqlclient.a
-rw-r--r-- 1 root root     41246 Apr 25 11:48 libmysqlservices.a
-rw-r--r-- 1 root root 539894432 Apr 25 12:26 libmysqld.a
lrwxrwxrwx 1 root root        25 Apr 25 12:27 libmysqlclient.so.20 -> libmysqlclient.so.20.3.16
lrwxrwxrwx 1 root root        20 Apr 25 12:27 libmysqlclient.so -> libmysqlclient.so.20
drwxr-xr-x 3 root root      4096 Apr 25 12:27 plugin
drwxr-xr-x 2 root root        28 Apr 25 12:27 pkgconfig
[root@isso mysql-5.7.29]# 

如果lib目錄下面沒有生成如圖所示的.so動態(tài)庫文件和.a靜態(tài)庫文件,那么說明安裝不成功(即使成功了也可能會導(dǎo)致php進程無法找到mysql的相關(guān)庫文件)。


image.png

設(shè)置MySQL的配置文件my.cnf
編譯生成的my.cnf文件在/etc/my.cnf.rpmsave中

[client]
#password       = your_password
port            = 3306
socket          = /data/company/company_program//mysql-5.7.34/tmp/mysql.sock
default-character-set=utf8mb4
[mysqld]
user = mysql
port            = 3306
server-id = 1
lower_case_table_names=1
socket          = /data/company/company_program//mysql-5.7.34/tmp/mysql.sock
basedir = /data/company/company_program//mysql-5.7.34
datadir = /data/company/company_program//mysql-5.7.34/data
default_storage_engine = InnoDB
character-set-server = utf8mb4
#default-character-set=utf8mb4

log-error = /data/company/company_program//mysql-5.7.34/logs/error.log
pid-file = /data/company/company_program//mysql-5.7.34/logs/mysql.pid
general_log = 1
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
skip-name-resolve
back_log = 300

max_connections = 1000
max_connect_errors = 6000
open_files_limit = 65535
table_open_cache = 256
key_buffer_size = 64M
max_allowed_packet = 200G
binlog_cache_size = 1M
max_heap_table_size = 8M
tmp_table_size = 64M

sort_buffer_size = 8M
join_buffer_size = 28M
key_buffer_size = 512M

read_buffer_size = 2M
read_rnd_buffer_size = 8M
thread_cache_size = 32
query_cache_type = 1
query_cache_size = 32M
query_cache_limit = 2M

ft_min_word_len = 4

log_bin = mysql-bin
binlog_format = mixed
expire_logs_days = 30

performance_schema = 0
explicit_defaults_for_timestamp

net_buffer_length = 4K

myisam_sort_buffer_size = 16M
myisam_repair_threads = 1

interactive_timeout = 28800
wait_timeout = 28800

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

sql_mode="NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES"
#sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
explicit_defaults_for_timestamp = true


log-bin=mysql-bin
binlog_format=mixed

expire_logs_days = 10
slow_query_log=1
slow-query-log-file=/data/company/company_program//mysql-5.7.34/logs/mysql-slow.log
long_query_time=3
#log_queries_not_using_indexes=on


innodb_data_home_dir = /data/company/company_program//mysql-5.7.34/data
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /data/company/company_program//mysql-5.7.34/data
innodb_buffer_pool_size = 256M
innodb_log_file_size = 128M
innodb_log_buffer_size = 32M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 2
innodb_write_io_threads = 2

[mysqldump]
#user=root
#password="3a853e98fe66636e"
quick
max_allowed_packet = 500M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 512M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M

[mysqlhotcopy]
interactive-timeout

把my.cnf放到/etc目錄下。

添加mysql的環(huán)境變量
將MySQL編譯生成的bin目錄添加到當(dāng)前Linux系統(tǒng)的環(huán)境變量中

 echo -e '\n\nexport PATH=/data/company/company_program/mysql-5.7.34/bin:$PATH\n' >> /etc/profile && source /etc/profile

或者 vim /etc/profile

export JAVA_HOME=/data/company/company_program/java8
export JRE_HOME=/data/company/company_program/java8/jre
export NGINX_HOME=/usr/local/nginx/sbin
export MYSQL_HOME=/data/company/company_program/mysql-5.7.34

export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JRE_HOME/lib:$NGINX_HOME:$MYSQL_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$NGINX_HOME:$MYSQL_HOME/bin

配置生效

source /etc/profile

相關(guān)安全配置

[root@isso etc]# chown -R mysql:mysql /data/company/company_program/mysql-5.7.34

初始化MySQL自身的數(shù)據(jù)庫

#####參數(shù)user表示用戶,basedir表示mysql的安裝路徑,datadir表示數(shù)據(jù)庫文件存放路徑
mysqld --initialize-insecure --user=mysql --basedir=/data/company/company_program/mysql-5.7.34 --datadir=/data/company/company_program/mysql-5.7.34/data

cd ../../company_program/mysql-5.7.34/bin

./mysqld_safe  --user=mysql --basedir=/data/company/company_program/mysql-5.7.34  --datadir=data/company/company_program/mysql-5.7.34/data &
[root@www mysql-5.7.34]#  mysqld --initialize-insecure --user=mysql --basedir=/data/company/company_program/mysql-5.7.34 --datadir=/data/company/company_program/mysql-5.7.34/data
 100
 100
2021-04-25T09:27:28.165768Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-04-25T09:27:28.867366Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
mysqld: File '/data/company/company_program/mysql-5.7.34/logs/mysql-slow.log' not found (Errcode: 2 - No such file or directory)
2021-04-25T09:27:28.873974Z 0 [ERROR] Could not use /data/company/company_program/mysql-5.7.34/logs/mysql-slow.log for logging (error 2 - No such file or directory). Turning logging off for the server process. To turn it on again: fix the cause, then either restart the query logging by using "SET GLOBAL SLOW_QUERY_LOG=ON" or restart the MySQL server.
2021-04-25T09:27:28.876803Z 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: 744609e8-a5a8-11eb-aa43-00163e156267.
2021-04-25T09:27:28.877797Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-04-25T09:27:29.289950Z 0 [Warning] CA certificate ca.pem is self signed.
2021-04-25T09:27:29.407002Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
[root@www mysql-5.7.34]#
image.png

權(quán)限調(diào)整

[root@isso bin]# chmod -R 775 /data/company/company_program/mysql-5.7.34/logs/
[root@isso bin]# ll /data/company/company_program/mysql-5.7.34/logs/
total 8
-rwxrwxr-x 1 mysql mysql 1079 Apr 25 14:18 error.log
-rwxrwxr-x 1 mysql mysql  538 Apr 25 14:18 mysql-slow.log
[root@isso bin]#  cp /data/company/company_program/mysql-5.7.34/support-files/mysql.server  /etc/init.d/mysqld
圖片.png

增加可執(zhí)行權(quán)限

 chmod +x /etc/init.d/mysqld

添加到sysV服務(wù)

chkconfig --add mysqld
chkconfig mysqld on

啟動mysql服務(wù)

mysqld_safe --user=mysql --datadir=/data/company/company_program/mysql-5.7.34/data --log-error=/data/company/company_program/mysql-5.7.34/logs/error.log &

啟動

service mysqld start
圖片.png

然后使用下面這命令ps -ef | grep mysql和netstat -tunpl | grep 3306查看MySQL服務(wù)進程和端口監(jiān)聽情況:


圖片.png

初始化MySQL數(shù)據(jù)庫的root用戶密碼:

 mysql_secure_installation
[root@isso bin]#  mysql_secure_installation
mysql_secure_installation: [ERROR] unknown option '--no-auto-rehash'

Securing the MySQL server deployment.
保護MySQL服務(wù)器部署。
Connecting to MySQL using a blank password.
使用空密碼連接到MySQL。

VALIDATE PASSWORD PLUGIN can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD plugin?
驗證密碼插件可用于測試密碼
提高安全性。它檢查密碼的強度
并允許用戶只設(shè)置
足夠安全。是否要設(shè)置驗證密碼插件?
Press y|Y for Yes, any other key for No: y
按y | y表示是,按任何其他鍵表示否:y
There are three levels of password validation policy:
There are three levels of password validation policy:
LOW    Length >= 8【只需要長度大于或等于8】
MEDIUM Length >= 8, numeric, mixed case, and special characters 【還需要包含數(shù)字、大小寫和類似于@#%等特殊字符】
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file
【還需要包含字典文件】
Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 1
Please set the password for root here.1
安全級別選中等
New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.
是否繼續(xù)使用提供的密碼?(按y | y表示是,按任何其他鍵表示否):y
默認情況下,MySQL安裝有一個匿名用戶,
允許任何人登錄MySQL而不必
為他們創(chuàng)建的用戶帳戶。這只是為了
測試,使安裝更順利。
你應(yīng)該在投入生產(chǎn)前把它們?nèi)サ?環(huán)境。
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.
通常,根目錄只允許從
“本地主機”。這保證了有人不能猜到
來自網(wǎng)絡(luò)的根密碼。
不允許遠程根登錄?(按y | y表示是,按任何其他鍵表示否):n
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.
默認情況下,MySQL附帶一個名為“test”的數(shù)據(jù)庫
任何人都可以進入。這也只是為了測試,
在投入生產(chǎn)之前應(yīng)該移除
環(huán)境。
刪除測試數(shù)據(jù)庫并訪問它?(按y | y表示是,按任何其他鍵表示否):y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.
重新加載特權(quán)表將確保所有更改
到目前為止所做的將立即生效。
現(xiàn)在重新加載特權(quán)表?(按y | y表示是,按任何其他鍵表示否):y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done! 

密碼:自己想設(shè)置的root用戶的登錄密碼。

將MySQL數(shù)據(jù)庫的動態(tài)鏈接庫共享至系統(tǒng)鏈接庫

一般MySQL數(shù)據(jù)庫還會被類似于PHP等服務(wù)調(diào)用,所以我們需要將MySQL編譯后的lib庫文件添加至當(dāng)前Linux主機鏈接庫/etc/ld.so.conf.d/下,這樣MySQL服務(wù)就可以被其它服務(wù)調(diào)用了。

[root@www bin]# echo "/data/company/company_program/mysql-5.7.34/lib" > /etc/ld.so.conf.d/mysql.conf

[使生效]

[root@isso bin]# ldconfig

[查看效果]

[root@www bin]# ldconfig -v |grep mysql 
ldconfig: Can't stat /libx32: No such file or directory
ldconfig: Path `/usr/lib' given more than once
ldconfig: Path `/usr/lib64' given more than once
ldconfig: Can't stat /usr/libx32: No such file or directory
/data/company/company_program/mysql-5.7.34/lib:
    libmysqlclient.so.20 -> libmysqlclient.so.20.3.21
[root@www bin]# 
image.png

登錄mysql

/data/ttwis/ttwis_program/mysql-5.7.29/lib:
    libmysqlclient.so.20 -> libmysqlclient.so.20.3.16
[root@isso bin]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.29-log Source distribution

Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

創(chuàng)建其它MySQL數(shù)據(jù)庫用戶(未使用)
使用MySQL數(shù)據(jù)庫root管理員用戶登錄MySQL數(shù)據(jù)庫后,可以管理數(shù)據(jù)庫和其他用戶了。這里演示創(chuàng)建一個名為typecodes的MySQL用戶(密碼為@typecodes2014.com)和一個名為typecodes的數(shù)據(jù)庫。

[root@typecodes mysql]# mysql -uroot -p密碼

######登錄成功后,創(chuàng)建typecodes數(shù)據(jù)庫,并設(shè)置字符集和字符校
mysql> CREATE DATABASE `typecodes` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

######創(chuàng)建名為typecodes用戶,并讓它擁有typecodes數(shù)據(jù)庫所有的權(quán)限
mysql> grant all privileges on typecodes.* to typecodes@localhost identified by '@typecodes2014.com';
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;            [創(chuàng)建完畢,root用戶退出]

授權(quán)可以遠程訪問
https://www.cnblogs.com/xiaofu007/p/10513845.html

//grant all privileges on *.* to root@'%'identified by 'passwd';
GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "自己設(shè)置好的root密碼";
flush privileges;

GRANT ALL PRIVILEGES ON . TO root@"%" IDENTIFIED BY "Ttwis@8852";
設(shè)置可以遠程訪問

阿里云或者騰訊云記得在“本實例安全組”中開放必要的端口,比如mysql的3306。

查看端口

netstat -nupl (UDP類型的端口)
netstat -ntpl (TCP類型的端口)

重啟mysql

service mysqld restart

service mysqld start

設(shè)置開機自啟動
創(chuàng)建用于啟動MySQL的配置文件

[root@localhost ~]# touch /usr/lib/systemd/system/mysqld.service
[root@localhost ~]# cd /usr/lib/systemd/system

vim mysqld.service

[Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target

[Install]
WantedBy=multi-user.target

[Service]
User=mysql
Group=mysql
ExecStart=/data/company/company_program/mysql-5.7.34/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000

修改mysqld.service所屬用戶組,保持和配置文件一致

chown -R mysql:mysql mysqld.service

啟動MySQL

systemctl start mysqld

設(shè)置自啟動

systemctl enable mysqld

重啟

reboot

查看MySQL是否自啟動

ps -ef|grep mysql

修改密碼:

1.關(guān)閉mysql服務(wù)

 net stop mysql 

2.找到mysql安裝路徑找到 my.ini 打開在 [mysqld] 下添加 skip-grant-tables 跳過密碼校驗 3.登陸mysql mysql -uroot -p密碼隨便輸入

4.進入MySQL 改密碼

mysql> update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';    ///123456自己的新密碼

*特別提醒注意的一點是,新版的mysql數(shù)據(jù)庫下的user表中已經(jīng)沒有Password字段了

5.記得把my.ini中的 skip-grant-tables 去掉否則誰都可以登陸我們的數(shù)據(jù)庫了</pre>


image

image
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容