时间:2021-07-01 10:21:17 帮助过:7人阅读
2.2 解压软件包
[root@mysql soft]# unzip V76360-01-rhel6.zip
2.3 rpm安装
[root@mysql soft]# rpm -ivh MySQL-server-advanced-5.6.25-1.el6.x86_64.rpm [root@mysql soft]# rpm -ivh MySQL-client-advanced-5.6.25-1.el6.x86_64.rpm
注:In most cases, you need to install only the MySQL-server
and MySQL-client
packages to get a functional MySQL installation
安装后在Linux系统中目录结构:
Directory |
Contents of Directory |
/usr/bin |
Client programs and scripts |
/usr/sbin |
The mysqld server |
/var/lib/mysql |
Log files, databases |
/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 |
3、MySQL启动与停止
MySQL安装完成后启动文件mysql在 /etc/init.d下
启动
[root@mysql bin]# /etc/rc.d/init.d/mysql start
Starting MySQL.. SUCCESS!
停止
/usr/bin/mysqladmin -u root -p shutdown
4、配置远程连接
mysql> GRANT ALL PRIVILEGES ON *.* TO root@‘%‘ IDENTIFIED BY ‘password‘; Query OK, 0 rows affected (0.01 sec) mysql> FLUSH PRIVILEGES;
5、安装时遇见的问题
安装过程中遇见了几个问题,网上搜索答案解决,谢谢大家的分享。在此再次总结一下
问题1:系统已安装包的冲突
解决
[root@mysql soft]# rpm -qa |grep mysql //查找冲突的包 mysql-libs-5.1.71-1.el6.x86_64 [root@mysql soft]# yum -y remove mysql-libs-5.1.71-1.el6.x86_64 //卸载该包 再次安装
问题2:安装完成后MySQL未启动
安装完成后,未启动就开始连接MySQL,报错如下:
[root@mysql soft]# mysql
ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)
解决:启动MySQL即可
问题3:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)
解决:
[root@mysql bin]# /etc/init.d/mysql stop //强行停止MySQL [root@mysql bin]# /usr/bin/mysqld_safe --skip-grant-tables --skip-networking & // [root@mysql bin]# mysql -u root mysql mysql> update user set Password=PASSWORD(‘password‘) where user=‘root‘; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0 mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.01 sec) mysql> quit [root@mysql bin]# /etc/init.d/mysql restart //重启两遍 [root@mysql bin]# mysql -u root mysql mysql> SET PASSWORD=PASSWORD(‘passw0rd‘); //需执行此命令才能继续执行其他命令
MySQL安装配置
标签: