目录
■Linux的root用户直接登录,其他用户 【ERROR 1698 (28000)】
■windows连接Linux中的mysql(5.7.32),windows中安装的mysql(5.7.22)
■账号密码
mysql -uroot -proot123
■参照 tomcat 安装
https://blog.youkuaiyun.com/sxzlc/article/details/104139552
■安装包获取
---
● MySQL Community Server:Community是社区版本,开源免费,但不提供官方技术支持;
● MySQL Enterprise Edition:Enterprise企业版本,需付费,可以试用30天,提供官网技术支持;
● MySQL Cluster:Cluster集群版,开源免费,可将几个MySQL Server封装成一个Server;
https://dev.mysql.com/downloads/mysql/
(https://dev.mysql.com/downloads/mysql/5.7.html)
---
点击 上面的【Archives】可以选择历史版本
---
■Linux版本升级
Linux 系统版本太老了,升级了Linux版本
apt-get upgrade
apt list --upgradable
reboot
ーーー
apt-get upgrade
apt install update-manager
do release-upgrade
ーーー
■安装mysql
---
tar -xvf mysql-server_5.7.32-1ubuntu18.04_amd64.deb-bundle.tar
groupadd mysql
useradd -r -g mysql mysql
cd /var/lib/dpkg/info/
dpkg -i mysql-common_5.7.32-1ubuntu18.04_amd64.deb
dkpg -i libmysqlclient20_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i libmysqlclient20_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i libmysqld-dev_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i mysql-community-server_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i mysql-server_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i mysql-community-client_5.7.32-1ubuntu18.04_amd64.deb
dpkg -i mysql-client_5.7.32-1ubuntu18.04_amd64.deb
/etc/init.d/mysql start
/etc/init.d/mysql stop
---
■安装后,启动mysql
---
---
---
■数据库用户信息
---
初次安装完毕之后,root用户默认密码是空值。
---
---
■Linux的root用户直接登录,其他用户 【ERROR 1698 (28000)】
---
plugin : auth_socket 会造成不需要密码,直接登录 (需要在Linux 的 root 用户下,执行 mysql)
普通用户登录时,会造成如下错误信息
sxz001@sxzap01:~$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
---
■重新设置root用户的密码
update user set authentication_string=password("root123"),plugin='mysql_native_password' where user='root';
然后重新启动 mysql, 上面的问题【ERROR 1698 (28000)】解决
/etc/init.d/mysql start
/etc/init.d/mysql sto
■配置文件
cat /etc/mysql/my.cnf
!includedir /etc/mysql/conf.d/
---
cat /etc/mysql/mysql.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
---
cat /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
datadir = /var/lib/mysql
log-error = /var/log/mysql/error.log
# By default we only accept connections from localhost
bind-address = 127.0.0.1
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
■本地连接
mysql -uroot -proot123 -h192.168.131.128
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1130 (HY000): Host '192.168.131.1' is not allowed to connect to this MySQL server
原因1:bind-address = 127.0.0.1
解决:注释掉即可
原因2:
解决
update user set host='%' where user='root';
---
■windows连接Linux中的mysql(5.7.32),windows中安装的mysql(5.7.22)
---比较,下面是windows安装的 mysql
■Mysql常用命令
https://blog.youkuaiyun.com/sxzlc/article/details/6003605