mysql坏了,极艰难的卸载完了。
感觉重装mysql还是挺常见的,有必要记录一下,免的下次麻烦。
rpm -ivh mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server mysql-devel mysql
service mysqld start启动起来了
mysql
-bash: /usr/local/mysql/bin/mysql: 没有那个文件或目录
vim /etc/profile 修改$PATH mysql的位置错误
免密进入
[mysqld]
skip-grant-tables
service mysqld restart
# 免密进入后需要设置密码
alter user 'root'@'localhost' identified by '2020';
# 重新进入
mysqladmin -u root password '2020'
use mysql;
# 创建新用户
create user 'me'@'%' identified by '2020';
#给权限
GRANT ALL PRIVILEGES ON *.* TO 'me'@'%' IDENTIFIED BY '2020' WITH GRANT OPTION;
FLUSH PRIVILEGES;
# 所有用户密码修改
UPDATE user SET Password = PASSWORD('2020') WHERE Host = '%' AND User = 'me';
update user set authentication_string=password("2020") where host='localhost' or host='%';
create datebase scm;
use scm;