rpm -ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm
如果报文件冲突:file /usr/share/mysql/l from install of mysql-community-common-5.7.18-1.el7.x86_64 conflicts with file from package mariadb-libs-1:5.5.s.x86_64
解决办法:
执行以下命令,删除mariadb-libs-1:5.5.44
yum -y remove mariadb-libs-1:5.5.44*
再执行以下命令安装MySQL:
rpm -ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm
/
etc/myf
mysql下载后的初次使用
Directory
Contents of Directory
/usr/bin
Client programs and scripts
/usr/sbin
The mysqld server
/var/lib/mysql
Log files, databases
/var/lib/mysql-files
Value of secure_file_priv
/usr/share/info
MySQL manual in Info format
/usr/share/man
Unix manual pages
/usr/include/mysql
Include (header) files
/usr/lib/mysql
Libraries
/usr/share/mysql
Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation
/usr/share/sql-bench
Benchmarks
启动mysql
systemctl enable mysqld //设置开机自启动
systemctl start mysqld
 
尝试进入mysql
mysql -uroot -p
密码为空
systemctl start  mysqld.service
centos 7系统:
mysqld --user=mysql --skip-grant-tables --skip-networking &
mysql
Mysql5.6(含)执行下面的语句没错
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
但是Mysql5.7中password字段变为了authentication_string,所以语句如下:
mysql> update mysql.user set authentication_string=password('root123') where user='root'
mysql> flush privileges;
mysql> quit
此时,mysql -uroot -p已经可以让你进去mysql了,之后还要再次修改一次密码,才可使用查表等语句:
 mysql>SET PASSWORD = PASSWORD('root123')

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。