失效链接处理 |
数据库日常笔记 PDF 下载
本站整理下载:
相关截图:
主要内容:
安装
Linux平台安装
创建用户
groupadd mysql
useradd -s /sbin/nologin -M -g mysql mysql
useradd -g mysql mysql -d /home/mysql -s /sbin/nologin
chown mysql:mysql -R /mysql
数据库初始化
cd /mysql/mysql/bin
./mysqld –user=mysql –basedir=/mysql/mysql –datadir=/mysql/mysql/data –initialize
生成临时密码
2016-05-13T00:19:19.691854Z 1 [Note] A temporary password is generated for root@localhost: X=Hgvio2emY#
修改配置文件中的参数
1
2
cd /mysql/mysql/support-files/
vi mysql.server
basedir=/mysql/mysql
datadir=/mysql/mysql/data
生成全局参数配置文件:
[root@primary support-files]# cp /mysql/mysql/support-files/my-default.cnf /etc/my.cnf
启动 MYSQL:
[root@primary mysql]# ./support-files/mysql.server start
Starting MySQL..[ OK ]
创建自动启动:
cp /mysql/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig –add mysqld
chkconfig –list mysqld
chkconfig –level 2345 mysqld on
chkconfig mysqld on
检查端口,验证数据库是否启动:
netstat -lntup |grep 330
ss -lntup |grep 330
进入后修改密码:
mysql> alter user ‘ root ’ @’ localhost ’ identified by ‘ root ’;
Query OK, 0 rows affected (0.00 sec)
快
|