centos之mysql安装配置使用
安装: 这里只安装得时mysql5.1,如果想安装5.6,看这里http://www.cnblogs.com/xuange306/p/8243859.html
yum install -y mysql-server
使用
- 重启: service mysqld restart
初次安装mysql,root账户没有密码。

#进入控制台
[root@yl-web yl]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.26 MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.01 sec) mysql>

设置密码(不需要重启数据库即可生效)。
mysql> set password for 'root'@'localhost' =password('123456');
Query OK, 0 rows affected (0.00 sec)
mysql>
配置
mysql配置文件为/etc/my.cnf
1、编码
mysql配置文件为/etc/my.cnf
最后加上编码配置
[mysql]
default-character-set =utf8
这里的字符编码必须和/usr/share/mysql/charsets/Index.xml中一致。

2、远程连接设置
把在所有数据库的所有表的所有权限赋值给位于所有IP地址的root用户。
mysql> grant all privileges on *.* to root@'%'identified by '123456';
如果是新用户而不是root,则要先新建用户
mysql>create user 'username'@'%' identified by 'password';
此时就可以进行远程连接了。
centos之mysql安装配置使用的更多相关文章
- Centos 下mysql安装配置
一.编译安装MySQL前的准备工作 安装编译源码所需的工具和库 yum install gcc gcc-c++ ncurses-devel perl 安装cmake,从http://www.cmake ...
- CentOS 6.6安装配置LAMP服务器(Apache+PHP5+MySQL)
准备篇: CentOS 6.6系统安装配置图解教程 http://www.osyunwei.com/archives/8398.html 1.配置防火墙,开启80端口.3306端口 vi /etc/s ...
- CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)
CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: /etc/init.d/iptables stop #关闭防火墙 关闭SELINUX vi /etc/sel ...
- CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)
这篇文章主要介绍了CentOS 6.4安装配置LAMP服务器(Apache+PHP5+MySQL)的方法,需要的朋友可以参考下 文章写的不错,很详细:IDO转载自网络: 准备篇: 1.配置防火墙,开启 ...
- CentOS 6.3安装配置LAMP服务器(Apache+PHP5+MySQL)
准备篇: 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tcp -p tcp -- ...
- CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL)的方法
CentOS 6.5安装配置LAMP服务器(Apache+PHP5+MySQL)的方法 准备篇: 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A I ...
- CentOS 6.3安装配置LAMP服务器(Linux+Apache+MySQL+PHP5)
服务器系统环境:CentOS 6.3 客户端系统环境:Windows 7 ultimate(x86)sp1 简体中文旗舰版 ※ 本文档描述了如何在Linux服务器配置Apache.Mysql.PHP ...
- CentOS 5.11安装配置LAMP服务器(Apache+PHP5+MySQL)
http://www.osyunwei.com/archives/8880.html 准备篇: CentOS 5.x系统安装配置图解教程 http://www.osyunwei.com/archive ...
- CentOS 7.0安装配置LAMP服务器(Apache+PHP+MariaDB)
CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止fir ...
随机推荐
- Hadoop Steaming开发之WordCount
简单的WordCount栗子--类似于编程语言中的hello world 1.shell脚本run.sh HADOOP_CMD="/usr/local/src/hadoop-1.2.1/bi ...
- 接口转换 数据库列表的内容 显示在datagrid
public class AddressConverter : IValueConverter { public object Convert(object value, Type targetTyp ...
- python的MySQLdb库链接MySQL入门代码
链接:http://www.runoob.com/python/python-mysql.html
- 【Boost】boost::tokenizer详解
分类: [C++]--[Boost]2012-12-28 21:42 2343人阅读 评论(0) 收藏 举报 目录(?)[+] tokenizer 库提供预定义好的四个分词对象, 其中char ...
- centos6.8安装httpd后无法访问
1.打开 httpd.conf 将里面的 #ServerName localhost:80 注释去掉 2.修改SELinux状态: 1)/usr/sbin/sestatus -v ##如果S ...
- 【BZOJ 2119】股市的预测(SAM)
SAM很好用的啊... 传送门 双倍经验:L-Gap Substrings 基本做法类似,这道题的差分改掉,map 改掉就好了QWQ noteskey 反正就是先差分一下,然后把首项丢掉(没有比较的对 ...
- epoll机制详解
epoll机制详解 大牛的详解 epoll详解 什么是epoll? epoll是为处理大批量句柄而作了改进的poll, 是性能最好的多路I/O就绪通知方法; 只有三个系统调用: epoll_creat ...
- C# 获取区域和语言值
其他方法如 System.Globalization.CultureInfo.InstalledUICulture.Name == "zh-CN" 不能获取.只有通过读注册表的方法 ...
- 防火墙iptables的简单使用
规则定义 # service iptables start # chkconfig iptables on 想让规则生效,则shell命令行下执行 sh /bin/iptables.sh即可 [roo ...
- maven项目板块的pom.xml配置
项目名为helloweb 项目文件结构图1 helloweb>pom.xml内容如下: <project xmlns="http://maven.apache.org/POM/4 ...