免責聲明

Disclaimer (免責聲明)
繼續閱覽代表您接受以上的免責聲明.
To continue reading means you accept the above disclaimer.

2015年4月1日 星期三

mysql installation on ubuntu


//=== https://www.linode.com/docs/databases/mysql/using-mysql-relational-databases-on-ubuntu-14-04-lts-trusty-tahr

$ sudo apt-get update
$ sudo apt-get install mysql-server
[both mysql client and server will be installed]


*** After installing MySQL, it’s recommended that you run mysql_secure_installation to help secure MySQL.

$ mysql_secure_installation

Change the root password? [Y/n] n
... skipping.

Remove anonymous users? [Y/n] Y
... Success!

Normally, root should only be allowed to connect from 'localhost'.
...
Disallow root login remotely? [Y/n] Y
... Success!

...
Remove test database and access to it? [Y/n] Y
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
... Success!

Cleaning up...

//=== to sum up what mysql_secure_installation have done
0. change root password [must if empty passwd is chosen during installation ]
1. remove anonymous users
2. disallow root login from non-localhost machine
3. remove test database
4. flush privileges

then restart mysql server
/etc/init.d/mysql restart


*** if you’ve forgotten your root password, use dpke-reconfigure to change that password:
$ sudo dpkg-reconfigure mysql-server-5.5


沒有留言:

張貼留言