centos 安装 mysql
来源:互联网 发布:淘宝店铺多久才能有钻 编辑:程序博客网 时间:2024/06/10 19:07
yum安装mysql
下载mysql
cd /usr/localmkdir softcd soft
wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
rpm -ivh mysql-community-release-el7-5.noarch.rpm
yum install mysql-community-server
service mysqld restart
vim /etc/my.cnf
补充以下内容
[client]default-character-set=utf8[mysql]default-character-set=utf8[mysqld]init_connect='SET collation_connection = utf8_unicode_ci'init_connect='SET NAMES utf8'character-set-server=utf8collation-server=utf8_unicode_ciskip-character-set-client-handshake
安装完成,接下来配置用户(默认安装后没有密码)
mysql -u root
查看当前用户
select user,host from mysql.user;
delete from mysql.user where user='';
创建用户
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
创建数据库
create database `test` default character set utf8 collate utf8_general_ci;
给用户权限
grant all privileges on seckill.* to seckill@'%' identified by 'seckill' with grant option;
刷新权限
flush privileges;
设置root密码
set password for root@localhost=password('123456');set password for root@127.0.0.1=password('123456');
导入.sql
use test;source /usr/local/test.sql;select * from test\G;
删除root 远程用户
use mysql;select host,user from user where user='root';delete from user where user='root' and host='%';flush privileges;select host,user from user where user='root';
阅读全文
0 0
- 安装centos安装mysql
- centos 安装mysql
- centos 安装MySQL全过程
- CentOS下安装mysql
- CentOS下安装mysql
- centos 安装MySQL全过程
- CentOS mysql安装
- CentOS 安装 配置mysql
- Centos 安装Mysql
- centos 安装MySQL全过程
- centos mysql 安装
- centos下安装mysql
- centos下面安装mysql
- CentOS 安装MySQL全过程
- centos 安装mysql
- centOS yum 安装mysql
- CentOS安装MYSQL
- centOS yum 安装mysql
- 日记—9.28
- 第二个shell程序------字符串变量操作
- 初识c#---委托,事件和观察者模式(Observer)设计模式
- bzoj 3162: 独钓寒江雪 树哈希+树形dp
- WKWebView 使用HTML 播放本地视频
- centos 安装 mysql
- HDU 5201 The Monkey King(容斥原理)
- eclipse的“Ctrl+Alt+下”快捷键与Win10冲突
- jqGrid|初始化|参数
- Zookeeper系列(一)
- 稀疏编码的一些内容,待整理
- leetcode--16. 3Sum Closest
- 约德尔测试,来自赛码网,初级算法
- Idea