赞
踩
rpm -qa | grep mysql
返回空值,说明没有安装
yum remove mysql
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
安装这个包后,会获得两个mysql的yum repo源:
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo
sudo yum install mysql-server
安装后再次查看mysql
rpm -qa | grep mysql
6.1赋权限
chown root /var/lib/mysql/
6.2 查看是否赋权
cd /var/lib/
ll
service mysqld status
service mysqld start
6.3登录
mysql -u root
6.4重置密码
use mysql;
update user set password=password('123456') where user='root';
exit;
service mysqld restart
mysql -uroot -p123456
设置数据库用户在所有ip下以及在本地可访问,以下用root用户做演示
grant all privileges on *.* to root@"%" identified by "你的密码";
grant all privileges on *.* to root@"localhost" identified by "你的密码";
flush privileges;
show variables like "%char%";
需要修改编码格式为UTF-8,导入数据库sql的时候,确保sql文件为utf8编码
set names utf8;
开发3306端口
firewall-cmd --reload ```
- 1
如果报错,内容含有
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
解决:
yum install glibc.i686
yum list libstdc++*
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。