D.mysql

Last-modified: 2006-10-10 (火) 06:00:39

swisspc:~# apt-get install mysql-server
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:

 libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client

Suggested packages:

 dbishell libcompress-zlib-perl mysql-doc

The following NEW packages will be installed:

 libdbd-mysql-perl libdbi-perl libnet-daemon-perl libplrpc-perl mysql-client
 mysql-server

0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Need to get 4881kB of archives.
After unpacking 11.8MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.jp.debian.org stable/main libnet-daemon-perl 0.38-1 [46.0kB]
Get:2 http://ftp.jp.debian.org stable/main libplrpc-perl 0.2017-1 [35.0kB]
Get:3 http://ftp.jp.debian.org stable/main libdbi-perl 1.46-6 [606kB]
Get:4 http://ftp.jp.debian.org stable/main libdbd-mysql-perl 2.9006-1 [132kB]
Get:5 http://ftp.jp.debian.org stable/main mysql-client 4.0.24-10sarge2 [415kB]
Get:6 http://ftp.jp.debian.org stable/main mysql-server 4.0.24-10sarge2 [3646kB]
Fetched 4881kB in 4s (995kB/s)
Preconfiguring packages ...

Debian Configuration

lqqqqqqqqqqqqqqqqqqqqqqqqqqqqu Configuring mysql-server tqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x                                                                                     x
x Install Hints                                                                       x
x                                                                                     x
x MySQL will only install if you have a NON-NUMERIC hostname that is resolvable via   x
x the /etc/hosts file. E.g. if the "hostname" command returns "myhostname" then       x
x there must be a line like "10.0.0.1 myhostname".                                    x
x                                                                                     x
x A new mysql user "debian-sys-maint" will be created. This mysql account is used in  x
x the start/stop and cron scripts. Don't delete.                                      x
x                                                                                     x
x Please remember to set a PASSWORD for the MySQL root user! If you use a             x
x /root/.my.cnf, always write the "user" and the "password" lines in there, never     x
x only the password! See /usr/share/doc/mysql-server/README.Debian for more           x
x information.                                                                        x
x                                                                                     x
x                                       <Ok>                                          x
x                                                                                     x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

Selecting previously deselected package libnet-daemon-perl.
(Reading database ... 26202 files and directories currently installed.)
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.38-1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2017-1_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.46-6_i386.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_2.9006-1_i386.deb) ...
Selecting previously deselected package mysql-client.
Unpacking mysql-client (from .../mysql-client_4.0.24-10sarge2_i386.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_4.0.24-10sarge2_i386.deb) ...
Setting up libnet-daemon-perl (0.38-1) ...

Setting up libplrpc-perl (0.2017-1) ...

Setting up libdbi-perl (1.46-6) ...
Setting up libdbd-mysql-perl (2.9006-1) ...
Setting up mysql-client (4.0.24-10sarge2) ...
Setting up mysql-server (4.0.24-10sarge2) ...
Stopping MySQL database server: mysqld.
Starting MySQL database server: mysqld.
Checking for crashed MySQL tables in the background.

swisspc:~#

skier-ch:~# mysql -u root

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 4.0.24_Debian-10sarge2-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select user,host,password from mysql.user;
+------------------+-----------+------------------+
| user             | host      | password         |
+------------------+-----------+------------------+
| root             | localhost |                  |
| root             | skier-ch  |                  |
| debian-sys-maint | localhost | **************** |
+------------------+-----------+------------------+
3 rows in set (0.01 sec)
mysql> set password for root@'skier-ch'=password('*******');
Query OK, 0 rows affected (0.00 sec)
mysql> set password for root@localhost=password('********');
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host,password from mysql.user;
+------------------+-----------+------------------+
| user             | host      | password         |
+------------------+-----------+------------------+
| root             | localhost | **************** |
| root             | skier-ch  | **************** |
| debian-sys-maint | localhost | **************** |
+------------------+-----------+------------------+
3 rows in set (0.00 sec)
skier-ch:~# mysql -u root
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)