cent0s6.5安装mysql
来源:互联网 发布:gitbash windows 编辑:程序博客网 时间:2024/06/11 03:03
第1步、yum安装mysql
[root@stonex ~]# yum -y install mysql-server
安装结果:
Installed:
mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency Installed:
mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6
第2步、设置开机启动
[root@stonex ~]# chkconfig mysqld on
第3步、启动MySql服务
[root@stonex ~]# service mysqld start
第4步、设置MySQL的root用户设置密码
[root@stonex ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
...... 省略了一些行
mysql> select user,host,password from mysql.user;
查询用户的密码,都为空,用下面的命令设置root的密码为root
mysql> set password for root@localhost=password('root');
mysql> exit
第5步、用新密码登陆
[root@stonex ~]# mysql -u root -p
第6步、基本命令
show databases; //查看系统已存在的数据库
use databasesname; //选择需要使用的数据库
drop database databasename; //删除选定的数据库
exit //退出数据库的连接
create database test01; //建立名为test的数据库
show tables; // 列出当前数据库下的表
其他基本的增删改查使用标准SQL即可
[root@stonex ~]# yum -y install mysql-server
安装结果:
Installed:
mysql-server.x86_64 0:5.1.73-3.el6_5
Dependency Installed:
mysql.x86_64 0:5.1.73-3.el6_5 perl-DBD-MySQL.x86_64 0:4.013-3.el6 perl-DBI.x86_64 0:1.609-4.el6
第2步、设置开机启动
[root@stonex ~]# chkconfig mysqld on
第3步、启动MySql服务
[root@stonex ~]# service mysqld start
第4步、设置MySQL的root用户设置密码
[root@stonex ~]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
...... 省略了一些行
mysql> select user,host,password from mysql.user;
查询用户的密码,都为空,用下面的命令设置root的密码为root
mysql> set password for root@localhost=password('root');
mysql> exit
第5步、用新密码登陆
[root@stonex ~]# mysql -u root -p
第6步、基本命令
show databases; //查看系统已存在的数据库
use databasesname; //选择需要使用的数据库
drop database databasename; //删除选定的数据库
exit //退出数据库的连接
create database test01; //建立名为test的数据库
show tables; // 列出当前数据库下的表
其他基本的增删改查使用标准SQL即可
第7步、开放远程登录权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
(完)
FLUSH PRIVILEGES;
(完)
0 0
- cent0s6.5安装mysql
- cent0S6.2安装oracle10g
- Cent0S6.4 安装virtual box 增强功能失败的解决方案
- mysql 5 编译安装
- MySQL 5 安装经历
- Linux 安装 mysql 5
- centos6.5安装mysql
- Centos6.5 mysql安装
- centOS6.5安装mysql
- CentOs6.5 安装mysql
- centos6.5安装mysql
- centos6.5安装mysql
- CentOS6.5 安装 Mysql
- Centos6.5 安装mysql
- centos6.5安装mysql
- centos6.5安装mysql
- centos6.5安装mysql
- centos6.5安装mysql
- GITHUB中上传本地文件-个人笔记
- 文章标题
- Mybatis学习笔记---day02关联关系查询
- vc在指定控件上绘制bmp
- jquery.validate在IE8下,点击提交不进行验证的解决方案
- cent0s6.5安装mysql
- nyoj 779 兰州烧饼
- 如何得到贝塞尔曲线的曲线长度和 t 的近似关系?
- <LeetCode> 题201:线段树的构造
- ZZULIOJ-1898-985的数字难题(水题)
- Android学习第八天---smali插桩
- zzulioj1897 985的红绿灯难题(数学)
- Scala之旅-class和object详解
- android沉浸式状态栏