- 论坛徽章:
- 0
|
Normal
0
7.8 磅
0
2
false
false
false
MicrosoftInternetExplorer4
st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
MySql 091216
@ http://zcatt.cublog.cn
Prepare
MySql 5.1.39
1.
Post-installation
1) mysql_install_db
program sets up the grant tables. If you install by RPM, it is runned
automatically.
2) use mysqladmin
to verify the server is running.
mysqladmin
version
mysqladmin
variables
mysqladmin
ping
mysqladmin
–u root shutdown
mysql_safe
–user=mysql –log &
mysqlshow
2. install mysql.server manually
1) copy mysql.server
to /etc/init.d, and rename as mysql.
Make it executable
cp
mysql.server /etc/init.d/mysql
chmod
+x /etc/init.d/mysql
2) Set mysql service to run automatically
at sys startup
chkconfig
--add mysql
or
chkconfig
--level 345 mysql on
3) Config /etc/my.cnf file
The sections are read by script in my.cnf,
see the table.
Script
Option Groups
mysqld
[mysqld], [server], [mysqld-major_version]
mysqld_safe
[mysqld], [server], [mysqld_safe]
mysql.server
[mysqld], [mysql.server], [server]
4) if err,
you can check the log files, host_name.err and host_name.log
tail
host_name.err
tail
host_name.log
3.
Securing the accounts
2) The initial root passwd is empty. One root account is for localhost, one is for
actual host name and IP number.
1) Two anonymous-user accounts are created
initally without passwd initially.
mysql
-u root
SET
PASSWORD FOR ‘’@’localhost’ = PASSWORD(‘newpwd’);
SET
PASSWORD FOR ‘’@’host_name’ = PASSWORD(‘newpwd’);
or remove the anonymous users
mysql
-u root
DROP
USER ‘’;
2) The initial root passwd is empty. One root account is for localhost, one is for
actual host name and IP number.
mysql
-u root
SET
PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘newpwd’);
SET
PASSWORD FOR ‘root’@’hostname’=PASSWORD(‘newpwd’);
or
mysqladmin
-u root password “newPwd”
mysqladmin
-u root -h host_name password “newpwd”
or
mysql
-u root
update
mysql.user set password=PASSWORD(‘newpwd’) where user =’root’;
flush
privileges;
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/8866/showart_2122819.html |
|