a. 下载mysql部署包mysql-5.1.72-linux-x86_64-glibc23.tar.gz
b. su
groupadd mysql
useradd -g mysql -m mysql -s /bin/bash
passwd mysql (mysql/mysql)
cd /usr/local
tar zxvf /home/chenxz/downloads/mysql-5.1.72-linux-x86_64-glibc23.tar.gz
ln -s mysql-5.1.72-linux-x86_64-glibc23 mysql
cd mysql
./scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
cp ./support_files/my-large.cnf /etc/my.cnf && chown -R mysql:mysql /etc/my.cnf
c. 启动/停止服务器(mysql用户登录)
./bin/mysqld_safe & / ./bin/mysqladmin -u root shutdown -p
./support-files/mysql.server start/stop
d. 密码权限设置
1. 更改匿名用户密码
shell> ./bin/mysql -u root
mysql> update mysql.user set Password = PASSWORD('test123') where User = '';
mysql> FLUSH PRIVILEGES;
2. 更改root用户密码
mysql> update mysql.user set Password = PASSWORD('root123') where User = 'root';
e. 学习操作mysql
1. 连接
./bin/mysql -u root -p
./bin/mysql -p
2. create database cxz_db; (数据库名和表名区分大小写)
3. create table tb1 (id int, value char(8));
4. show tables;
5. describe tb1;
6. 数据装入表中,可以使用LOAD DATA和INSERT语句
7. 创建用户并授权(也可以用Insert语句)
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'%' IDENTIFIED BY 'cxz123';
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'localhost' IDENTIFIED BY 'cxz123';
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'rock.dscc' IDENTIFIED BY 'cxz123';
8. 为一个数据库指定存储路径,可以采用建立符号链接的方式
b. su
groupadd mysql
useradd -g mysql -m mysql -s /bin/bash
passwd mysql (mysql/mysql)
cd /usr/local
tar zxvf /home/chenxz/downloads/mysql-5.1.72-linux-x86_64-glibc23.tar.gz
ln -s mysql-5.1.72-linux-x86_64-glibc23 mysql
cd mysql
./scripts/mysql_install_db --user=mysql
chown -R root .
chown -R mysql data
chgrp -R mysql .
cp ./support_files/my-large.cnf /etc/my.cnf && chown -R mysql:mysql /etc/my.cnf
c. 启动/停止服务器(mysql用户登录)
./bin/mysqld_safe & / ./bin/mysqladmin -u root shutdown -p
./support-files/mysql.server start/stop
d. 密码权限设置
1. 更改匿名用户密码
shell> ./bin/mysql -u root
mysql> update mysql.user set Password = PASSWORD('test123') where User = '';
mysql> FLUSH PRIVILEGES;
2. 更改root用户密码
mysql> update mysql.user set Password = PASSWORD('root123') where User = 'root';
e. 学习操作mysql
1. 连接
./bin/mysql -u root -p
./bin/mysql -p
2. create database cxz_db; (数据库名和表名区分大小写)
3. create table tb1 (id int, value char(8));
4. show tables;
5. describe tb1;
6. 数据装入表中,可以使用LOAD DATA和INSERT语句
7. 创建用户并授权(也可以用Insert语句)
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'%' IDENTIFIED BY 'cxz123';
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'localhost' IDENTIFIED BY 'cxz123';
GRANT ALL PRIVILEGES ON cxz_db.* TO 'cxz'@'rock.dscc' IDENTIFIED BY 'cxz123';
8. 为一个数据库指定存储路径,可以采用建立符号链接的方式