[root@ftp bin]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 687 to server version: 3.23.58
Type help; or \h for help. Type \c to clear the buffer.
mysql>
mysql> show databases;
+--------------+
Database
+--------------+
mysql
test
+--------------+
2.禁止MySQL导入本地文件
下面将禁止MySQL中用“LOAD DATA LOCAL INFILE”命令。这个命令会利用MySQL把本地文件读到数据库中,然后用户就可以非法获取敏感信息了。
为了禁止上述命令,在/chroot/mysql/etc/my.cnf文件的[mysqld]部分加入下面语句:
set-variable=local-infile=0
3.修改MySQL的root用户ID和密码
#chrootuid /chroot/mysql mysql /usr/local/mysql/libexec/mysqld &
#/usr/local/mysql/bin/mysql -uroot
.......
mysql>SET PASSWORD FOR root@localhost=PASSWORD(new_password);
要尽量养成在mysql下输入密码的习惯,因为Shell下面输入的时候可能会被其它人看见。
mysql>use mysql;
mysql>update user set user="wghgreat" where user="root";
mysql>select Host,User,Password,Select_priv,Grant_priv from user;
mysql>delete from user where user=;
mysql>delete from user where password=;
mysql>delete from user where host=%;
mysql>dropp database test;