root@classsample:~# apt-get install mysql-server Reading package lists... Done Building dependency tree Reading state information... Done The following extra packages will be installed: libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common mysql-server-5.0 Suggested packages: dbishell libcompress-zlib-perl mysql-doc-5.0 tinyca Recommended packages: libhtml-template-perl mailx The following NEW packages will be installed: libdbd-mysql-perl libdbi-perl libmysqlclient15off libnet-daemon-perl libplrpc-perl mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 0 upgraded, 9 newly installed, 0 to remove and 3 not upgraded. Need to get 0B/38.2MB of archives. After this operation, 112MB of additional disk space will be used. Do you want to continue [Y/n]? y Preconfiguring packages ... Configuring mysql-server-5.0 ---------------------------- While not mandatory, it is highly recommended that you set a password for the MySQL administrative "root" user. If that field is left blank, the password will not be changed. New password for the MySQL "root" user: Repeat password for the MySQL "root" user: Selecting previously deselected package mysql-common. (Reading database ... 17830 files and directories currently installed.) Unpacking mysql-common (from .../mysql-common_5.0.51a-3ubuntu5.4_all.deb) ... Selecting previously deselected package libnet-daemon-perl. Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1.1_all.deb) ... Selecting previously deselected package libplrpc-perl. Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1.1_all.deb) ... Selecting previously deselected package libdbi-perl. Unpacking libdbi-perl (from .../libdbi-perl_1.601-1_i386.deb) ... Selecting previously deselected package libmysqlclient15off. Unpacking libmysqlclient15off (from .../libmysqlclient15off_5.0.51a-3ubuntu5.4_i386.deb) ... Selecting previously deselected package libdbd-mysql-perl. Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.005-1_i386.deb) ... Selecting previously deselected package mysql-client-5.0. Unpacking mysql-client-5.0 (from .../mysql-client-5.0_5.0.51a-3ubuntu5.4_i386.deb) ... Setting up mysql-common (5.0.51a-3ubuntu5.4) ... Selecting previously deselected package mysql-server-5.0. (Reading database ... 18092 files and directories currently installed.) Unpacking mysql-server-5.0 (from .../mysql-server-5.0_5.0.51a-3ubuntu5.4_i386.deb) ... Selecting previously deselected package mysql-server. Unpacking mysql-server (from .../mysql-server_5.0.51a-3ubuntu5.4_all.deb) ... Setting up libnet-daemon-perl (0.38-1.1) ... Setting up libplrpc-perl (0.2017-1.1) ... Setting up libdbi-perl (1.601-1) ... Setting up libmysqlclient15off (5.0.51a-3ubuntu5.4) ... Setting up libdbd-mysql-perl (4.005-1) ... Setting up mysql-client-5.0 (5.0.51a-3ubuntu5.4) ... Setting up mysql-server-5.0 (5.0.51a-3ubuntu5.4) ... * Stopping MySQL database server mysqld [ OK ] Reloading AppArmor profiles : done. * Starting MySQL database server mysqld [ OK ] * Checking for corrupt, not cleanly closed and upgrade needing tables. Setting up mysql-server (5.0.51a-3ubuntu5.4) ... Processing triggers for libc6 ... ldconfig deferred processing now taking place root@classsample:~# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 5.0.51a-3ubuntu5.4 (Ubuntu) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> select User,Host,Password from user; ERROR 1046 (3D000): No database selected mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> select User,Host,Password from user; +------------------+-------------+-------------------------------------------+ | User | Host | Password | +------------------+-------------+-------------------------------------------+ | root | localhost | *09C5E307D62D667ABAA2BFE884D6B8CCA655CAEE | | root | classsample | *09C5E307D62D667ABAA2BFE884D6B8CCA655CAEE | | root | 127.0.0.1 | *09C5E307D62D667ABAA2BFE884D6B8CCA655CAEE | | | localhost | | | | classsample | | | debian-sys-maint | localhost | *A425D9C349272EAC2F330E42FE1C9D3370A2BCEB | +------------------+-------------+-------------------------------------------+ 6 rows in set (0.00 sec) mysql> SELECT User,Host,Password FROM user WHERE User = ''; +------+-------------+----------+ | User | Host | Password | +------+-------------+----------+ | | localhost | | | | classsample | | +------+-------------+----------+ 2 rows in set (0.00 sec) mysql> DELETE FROM user WHERE User = ''; Query OK, 2 rows affected (0.00 sec) mysql> SELECT Host,Db,User FROM db; +------+---------+------+ | Host | Db | User | +------+---------+------+ | % | test | | | % | test\_% | | +------+---------+------+ 2 rows in set (0.00 sec) mysql> SELECT Host,Db,User FROM db WHERE Db LIKE '%test%'; +------+---------+------+ | Host | Db | User | +------+---------+------+ | % | test | | | % | test\_% | | +------+---------+------+ 2 rows in set (0.01 sec) mysql> DELETE FROM db WHERE Db LIKE '%test%'; Query OK, 2 rows affected (0.00 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.00 sec) mysql> exit Bye root@classsample:~# emacs /etc/mysql/my.cnf root@classsample:~# diff /etc/mysql/my.cnf /etc/mysql/my.cnf~ 54c54 < #bind-address = 127.0.0.1 --- > bind-address = 127.0.0.1