CentOS安装MySQL-server-5.6.13-1.el6.x86_64.rpm
来源:互联网 发布:淘宝卖家模板 编辑:程序博客网 时间:2024/04/28 07:16
首先下载下面三个文件:
然后使用root账号登陆,进行安装:
1. 安装server、devel、client:1. 安装server、devel、client:
rpm -ivh --replacefiles MySQL-s*.rpm
rpm -ivh --replacefiles MySQL-d*.rpm
rpm -ivh --replacefiles MySQL-c*.rpm
01.
[root@localhost download]
# rpm -ivh --replacefiles MySQL-server-5.6.13-1.el6.x86_64.rpm
02.
Preparing...
########################################### [100%]
03.
1:MySQL-server
########################################### [100%]
04.
[root@localhost download]
# rpm -ivh --replacefiles MySQL-client-5.6.13-1.el6.x86_64.rpm
05.
Preparing...
########################################### [100%]
06.
1:MySQL-client
########################################### [100%]
07.
[root@localhost download]
# rpm -ivh --replacefiles MySQL-devel-5.6.13-1.el6.x86_64.rpm
08.
Preparing...
########################################### [100%]
09.
1:MySQL-devel
########################################### [100%]
要移除安装可以使用 rpm -e MySQL-server 、 rpm -e MySQL-devel、MySQL-client即可;
2. 初始化数据库:
/usr/bin/mysql_install_db
3. 启动mysql服务:
service mysql start
使用命令ps -ef | grep mysql 查看mysql进程:
1.
[root@localhost ~]
# ps -ef | grep mysql
2.
root 26047 1 0 18:14 pts/12 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-
file
=/var/lib/mysql/localhost.localdomain.pid
3.
mysql 26227 26047 0 18:14 pts/12 00:00:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-
dir
=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-
file
=/var/lib/mysql/localhost.localdomain.pid --socket=/var/lib/mysql/mysql.sock
4.
root 26545 24726 0 18:27 pts/8 00:00:00
grep
mysql
4.第一次登陆设置root密码:
首先查看 cat /root/.mysql_secret
1.
root@localhost ~]
# cat /root/.mysql_secret
2.
# The random pass<a href="http://www.it165.net/edu/ebg/" target="_blank" class="keylink">word</a> set for the root user at Fri Aug 30 15:57:18 2013 (local time): fMYcarvB
然后命令行:mysql -u root -p ,然后输入上面的密码即可:
01.
[root@localhost ~]
# mysql -u root -p
02.
Enter pass<a href=
"http://www.it165.net/edu/ebg/"
target=
"_blank"
class=
"keylink"
>word</a>:
03.
Welcome to the MySQL monitor. Commands end with ; or \g.
04.
Your MySQL connection
id
is 5
05.
Server version: 5.6.13 MySQL Community Server (GPL)
06.
07.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
08.
09.
Oracle is a registered trademark of Oracle Corporation and/or its
10.
affiliates. Other names may be trademarks of their respective
11.
owners.
12.
13.
Type 'help;' or '\h'
for
help. Type '\c' to
clear
the current input statement.
设置root密码:
1.
mysql>
use mysql
2.
Database changed
3.
mysql>
update user
set
password=password('root') where user='root';
4.
Query OK, 0 rows affected (0.15 sec)
5.
Rows matched: 5 Changed: 0 Warnings: 0
6.
7.
mysql>
flush privileges;
8.
Query OK, 0 rows affected (0.00 sec)
退出,重新登陆即可使用新的密码登陆;
如果use mysql时出现error,则
mysql> SET PASSWORD = PASSWORD('123456');
Query OK, 0 rows affected (0.03 sec)
也就是用mysql> SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码!
5. 设置远程登陆:
使用root登陆到mysql后
01.
mysql>
update user
set
host='%' where user='root';
02.
ERROR 1062 (23000): Duplicate entry '%-root'
for
key 'PRIMARY'
03.
mysql>
select
host,user from user;
04.
+-----------------------+------+
05.
| host | user |
06.
+-----------------------+------+
07.
| % | root |
08.
| 127.0.0.1 | root |
09.
| 192.168.128.142 | root |
10.
| ::1 | root |
11.
| localhost.localdomain | root |
12.
+-----------------------+------+
13.
5 rows
in
set
(0.00 sec)
然后:
1.
mysql>
grant all privileges on *.* to 'root'@'%' with grant option;
2.
Query OK, 0 rows affected (0.08 sec)
3.
4.
mysql>
exit
5.
Bye
6.
[root@localhost ~]
# service mysql restart
7.
Shutting down MySQL.. SUCCESS!
8.
Starting MySQL.. SUCCESS!
重启mysql即可远程登陆。
0 0
- CentOS安装MySQL-server-5.6.13-1.el6.x86_64.rpm
- RedHat 6.3安装MySQL-server-5.6.13-1.el6.x86_64.rpm
- 在RedHat 6.3下安装MySQL-server-5.6.13-1.el6.x86_64.rpm
- linux MySQL-server-5.5.34-1.el6.i686.rpm安装
- linux 下安装mysql-5.7.16-1.el6.x86_64.rpm-bundle
- linux6.5安装MySQL-5.5.53-1.el6.x86_64.rpm-bundle.tar
- linux 下安装mysql-5.7.16-1.el6.x86_64.rpm-bundle
- CentOS6.5安装mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
- 【待完成】CentOS6.5安装mysql-cluster-community-7.5.6-1.el6.x86_64.rpm-bundle.tar
- 在rpm安装mysql的时候报..conflicts with file from package mysql-libs-5.1.71-1.el6.x86_64的解决办法
- RPM安装与卸载MySQL-5.6.27-1.linux*.x86_64.rpm*
- RPM安装与卸载MySQL-5.6.27-1.linux*.x86_64.rpm*
- CentOS RPM安装MySQL-5.6
- CentOS RPM安装MySQL-5.6
- CentOS RPM 安装 mysql-5.6
- Linux el6安装MySQL-5.6
- CentOS 6.6 x86_64升级内核到最新版2.6.32-642.3.1.el6.x86_64
- Linux安装MySQL-5.6.24-1.linux_glibc2.5.x86_64.rpm-bundle.tar
- Loader与URLLoader区别的总结分析
- 硬盘零伤害
- Ubuntu14.04 chromium 安装 flash
- SubscriptionManager 的讲解
- Eclipse解决Android SDK Content Loader: (0%)
- CentOS安装MySQL-server-5.6.13-1.el6.x86_64.rpm
- 黑马程序员-String字符串练习
- UML7.5快捷键大全
- OC 多态理解
- teqc: currently cannot deal with an applied clock offset in QC mode
- 字符数组 与 字符指针(使用前分配内存)
- Leetcode_169_Majority Element
- 将spring的bean配置文件分模块定义
- linux驱动虚拟地址和物理地址的映射