linux下 安装mysql教程
2017-06-09 10:22
429 查看
安装环境:系统是 centos6.5
1、下载
下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
下载版本:我这里选择的5.6.33,通用版,linux下64位
也可以直接复制64位的下载地址,通过命令下载:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
2、解压
3、添加用户组和用户
4、安装
5.1 sqlyog连接时,报1130错误,是由于没有给远程连接的用户权限问题
直接授权
GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘youpassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
5.2 安装时的一些错误
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: 没有那个文件或目录
解决: yum -y install perl perl-devel
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决:yum -y install libaio-devel
centos 7.2 报错
出现如下异常:
FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper
解决方案:
]# yum install -y perl-Module-Install.noarch
5.3 设置root 密码
方法1: 用SET PASSWORD命令
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
方法2:用mysqladmin
mysqladmin -u root password "newpass"
如果root已经设置过密码,采用如下方法
mysqladmin -u root password oldpass "newpass"
方法3: 用UPDATE直接编辑user表
mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
在丢失root密码的时候,可以这样
mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
mysql> FLUSH PRIVILEGES;
6.1 配置环境变量
vi + /etc/profile
export PATH=....:/usr/local/mysql/bin
1、下载
下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
下载版本:我这里选择的5.6.33,通用版,linux下64位
也可以直接复制64位的下载地址,通过命令下载:wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
2、解压
直接授权
GRANT ALL PRIVILEGES ON *.* TO ‘root’@'%’ IDENTIFIED BY ‘youpassword’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
5.2 安装时的一些错误
-bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: 没有那个文件或目录
解决: yum -y install perl perl-devel
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
解决:yum -y install libaio-devel
centos 7.2 报错
出现如下异常:
FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:
Data::Dumper
解决方案:
]# yum install -y perl-Module-Install.noarch
5.3 设置root 密码
方法1: 用SET PASSWORD命令
mysql -u root
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
方法2:用mysqladmin
mysqladmin -u root password "newpass"
如果root已经设置过密码,采用如下方法
mysqladmin -u root password oldpass "newpass"
方法3: 用UPDATE直接编辑user表
mysql -u root
mysql> use mysql;
mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
mysql> FLUSH PRIVILEGES;
在丢失root密码的时候,可以这样
mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
mysql> FLUSH PRIVILEGES;
6.1 配置环境变量
vi + /etc/profile
export PATH=....:/usr/local/mysql/bin
相关文章推荐
- UBUNTU10.10安装LAMP(Linux、Apache、Mysql、Php)环境教程
- Linux下安装MySQL并为其创建新用户图解教程
- Linux CentOS6.5下编译安装MySQL 5.6.16【给力详细教程】
- Linux下安装mysql-5.6.4 的图文教程
- Linux下编译安装MySQL-Python教程
- Linux配置教程之四:mysql安装配置
- linux下mysql 最新版安装图解教程
- linux下mysql 最新版安装图解教程
- linux下mysql 最新版安装图解教程
- linux下mysql 最新版安装图解教程
- Linux下安装MySQL并为其创建新用户图解教程
- Linux下 mysql各种安装教程
- UBUNTU10.10安装LAMP(Linux、Apache、Mysql、Php)环境图文教程
- linux下mysql 最新版安装图解教程
- Unix/Linux环境C编程新手教程(24) MySQL 5.7.4 for Red Hat Enterprise 7(RHEL7)的安装
- linux (centos) 安装MySql详细教程!!实战详解
- linux安装mysql 5.6实时教程和配置
- linux下mysql 最新版安装图解教程
- Linux下安装MySQL并为其创建新用户图解教程