Redhat 5.4-64 安装mysql:
首先下载mysql安装包:
安装:
[root@mail mysql]# rpm -ivh MySQL-server-5.5.12-1.rhel5.x86_64.rpm
[root@mail mysql]# rpm -ivh MySQL-client-5.5.12-1.rhel5.x86_64.rpm
启动mysql:
[root@mail mysql]# service mysql start
查看mysql端口是否是3306
[root@mail mysql]# netstat -tulnp|grep 3306
tcp 0 0 :::3306 :::* LISTEN 27681/mysqld
没错就是这样了,
登陆mysql
[root@mail mysql]# mysql
[root@mail mysql]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.5.12 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
登陆成功
切换到mysql数据库
mysql> use mysql;
Database changed
mysql>
切换成功
7. root用户默认是没有密码的,下面咱们来修改root密码
update user set password=PASSWORD("mysql") where user='root';
8. quit退出
9. 使用root用户登陆
[root@mail mysql]# mysql -u root -p
输入刚才的密码登陆即可
10. 但是现在使用Navicat 还是不能登陆,那么现在我们来初始化数据库
mysql> update user set host='%' where user='root' LIMIT 1;
mysql> flush privileges;
% 代表所有用户都可以连接数据库,如果你想让某一个用户登陆其余的用户都不可以登陆那你就将%换成你要指定用户的IP即可,现在Navicat 也可以连接成功了。
很晚了,洗洗睡吧!!!