# cp /home/mysql/support-files/mysql.server /etc/init.d/mysqld # 拷贝启动文件到/etc/init.d/下并重命令为mysqld
# chmod 755 /etc/init.d/mysqld # 增加执行权限
# chkconfig
--list mysqld # 检查自启动项列表中没有mysqld这个,
# chkconfig
--add mysqld # 如果没有就添加mysqld:
# chkconfig mysqld
on
# 用这个命令设置开机启动:
如果在执行第一步就报错,则说明刚刚在第8步中配置出问题了,那你就重新设置一下
如果在执行第一步就报错,则说明刚刚在第8步中配置出问题了,那你就重新设置一下
做完这步后再重新执行下上面的操作 如果后面的操作中出现以下的问题
这样就是电脑环境的问题了,你就直接把
10、mysql服务的启动/重启/停止
1
2
3
|
# service mysqld start # 启动服务
# service mysqld restart # 重启服务
# service mysqld stop # 停止服务
|
11、初始化mysql用户root的密码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# cd /home/mysql
# ./bin/mysqladmin -u root -p
'**mjT,#x_5sW'
password
'123456'
mysqladmin: # 刚刚之前的初始密码
[Warning] Using a
passwrd
on
the command line interface can be insecure.
Warning: Since
password
will be sent
to
server
in
plain text, use ssl
connection
to
ensure
password
safety.
mysql> use mysql
Database
changed
mysql>
update
user
set
authentication_string =
PASSWORD
|