[root@localhost local]# rpm -ivh MySQL-server-5.5.32-2.rhel5.x86_64.rpm
error: Failed dependencies:
MySQL conflicts with mysql-5.0.77-4.el5_6.6.x86_64
[root@localhost local]#
[root@localhost local]# rpm -ivh MySQL-server-5.5.32-2.rhel5.x86_64.rpm --nodeps --force
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
安装mysql客户端
[root@localhost local]# rpm -ivh MySQL-client-5.5.32-2.rhel5.x86_64.rpm --nodeps --force
Preparing... ########################################### [100%]
1:MySQL-client ########################################### [100%]
[root@localhost local]#
启动mysql服务
[root@localhost local]# service mysql start
Starting MySQL......... [纭甝
[root@localhost local]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:997 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 912 192.168.64.128:22 192.168.64.1:5610 ESTABLISHED
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN
tcp 0 0 :::8009 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
tcp 0 0 :::22
修改密码
[root@localhost local]# /usr/bin/mysqladmin -u root password '123456'
登陆mysql
[root@localhost /]# mysql -u root -p
Enter password:
赋予root用户远程登陆权限
mysql> grant all on *.* to root@'%' identified by '123456'
-> ;
重启mysql
[root@localhost /]# service mysql restart
Shutting down MySQL. [纭甝
^[[?1;2cStarting MySQL.. [纭甝
使mysql不区分大小写
[root@localhost etc]# cd /usr/local/tomcat/bin/
[root@localhost etc]# vi my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
lower_case_table_names=1
添加行
lower_case_table_names=1 使mysql不区分大小写