Full process of installing MySQL 11.04 through apt in Ubuntu 5.1: Read: MySQL 5.5.11 compiling and Installation notes in Linux (complete installation tutorial) compile and install MySQL dual-instance in Ubuntu and configure master-slave replication Ubuntu 11.04 (32-bit) environment to compile and install MySQL 5.5 1) $ sudo 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 libhtml-template-perl libmysqlclient16 libnet-daemon-perl
libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server-5.1
mysql-server-core-5.1
Suggested packages:
libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient16 libnet-daemon-perl
libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server
mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 12 newly installed, 0 to remove and 28 not upgraded.
Need to get 23.9 MB of archives.
After this operation, 61.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-common all 5.1.54-1ubuntu4 [12.2 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-common all 5.1.54-1ubuntu4 [12.2 kB]
Get:3 http://cn.archive.ubuntu.com/ubuntu/ natty/main libnet-daemon-perl all 0.43-1 [46.9 kB]
Get:4 http://cn.archive.ubuntu.com/ubuntu/ natty/main libplrpc-perl all 0.2020-2 [36.0 kB]
Get:5 http://cn.archive.ubuntu.com/ubuntu/ natty/main libdbi-perl amd64 1.612-1 [846 kB]
Get:6 http://cn.archive.ubuntu.com/ubuntu/ natty/main libmysqlclient16 amd64 5.1.54-1ubuntu4 [1869 kB]
Get:7 http://cn.archive.ubuntu.com/ubuntu/ natty/main libmysqlclient16 amd64 5.1.54-1ubuntu4 [1869 kB]
Get:8 http://cn.archive.ubuntu.com/ubuntu/ natty/main libdbd-mysql-perl amd64 4.016-1 [140 kB]
Get:9 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-client-core-5.1 amd64 5.1.54-1ubuntu4 [102 kB]
Get:10 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-client-5.1 amd64 5.1.54-1ubuntu4 [9370 kB]
Get:11 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-client-5.1 amd64 5.1.54-1ubuntu4 [9370 kB]
Get:12 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-server-core-5.1 amd64 5.1.54-1ubuntu4 [4976 kB]
Get:13 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-server-5.1 amd64 5.1.54-1ubuntu4 [6386 kB]
Get:14 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-server-5.1 amd64 5.1.54-1ubuntu4 [6386 kB]
Get:15 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-server-5.1 amd64 5.1.54-1ubuntu4 [6386 kB]
Get:16 http://cn.archive.ubuntu.com/ubuntu/ natty/main libhtml-template-perl all 2.9-2 [67.1 kB]
Get:17 http://cn.archive.ubuntu.com/ubuntu/ natty/main mysql-server all 5.1.54-1ubuntu4 [6828 B]
...
2) set the password of the root account 3) installation process details
Selecting previously deselected package mysql-common.
(Reading database ... 50200 files and directories currently installed.)
Unpacking mysql-common (from .../mysql-common_5.1.54-1ubuntu4_all.deb) ...
Selecting previously deselected package libnet-daemon-perl.
Unpacking libnet-daemon-perl (from .../libnet-daemon-perl_0.43-1_all.deb) ...
Selecting previously deselected package libplrpc-perl.
Unpacking libplrpc-perl (from .../libplrpc-perl_0.2020-2_all.deb) ...
Selecting previously deselected package libdbi-perl.
Unpacking libdbi-perl (from .../libdbi-perl_1.612-1_amd64.deb) ...
Selecting previously deselected package libmysqlclient16.
Unpacking libmysqlclient16 (from .../libmysqlclient16_5.1.54-1ubuntu4_amd64.deb) ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.016-1_amd64.deb) ...
Selecting previously deselected package mysql-client-core-5.1.
Unpacking mysql-client-core-5.1 (from .../mysql-client-core-5.1_5.1.54-1ubuntu4_amd64.deb) ...
Selecting previously deselected package mysql-client-5.1.
Unpacking mysql-client-5.1 (from .../mysql-client-5.1_5.1.54-1ubuntu4_amd64.deb) ...
Selecting previously deselected package mysql-server-core-5.1.
Unpacking mysql-server-core-5.1 (from .../mysql-server-core-5.1_5.1.54-1ubuntu4_amd64.deb) ...
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up mysql-common (5.1.54-1ubuntu4) ...
Selecting previously deselected package mysql-server-5.1.
(Reading database ... 50575 files and directories currently installed.)
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.54-1ubuntu4_amd64.deb) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously deselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.9-2_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.54-1ubuntu4_all.deb) ...
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Setting up libnet-daemon-perl (0.43-1) ...
Setting up libplrpc-perl (0.2020-2) ...
Setting up libdbi-perl (1.612-1) ...
Setting up libmysqlclient16 (5.1.54-1ubuntu4) ...
Setting up libdbd-mysql-perl (4.016-1) ...
Setting up mysql-client-core-5.1 (5.1.54-1ubuntu4) ...
Setting up mysql-client-5.1 (5.1.54-1ubuntu4) ...
Setting up mysql-server-core-5.1 (5.1.54-1ubuntu4) ...
Setting up mysql-server-5.1 (5.1.54-1ubuntu4) ...
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
mysql start/running, process 2201
Setting up libhtml-template-perl (2.9-2) ...
Setting up mysql-server (5.1.54-1ubuntu4) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
dragon@usvm1104:~$
4) log on to the mysql command line and test $ mysql-uroot-p.
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.1.54-1ubuntu4 (Ubuntu)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
+--------------------+
2 rows in set (0.00 sec)
mysql>
5) Enable Mysql remote access. After MySQL is installed in Ubuntu by default, it can only be accessed from the local machine. To enable remote access, perform the following two steps: 1. modify the configuration file, comment out the bind-address restriction; $ sudo vi/etc/mysql/my. cnf finds bind-address = 127.0.0.1 and comment out this line. 2. Add a remote user: log on to mysql with the root user in the current machine, and then use the grant command to add the user, for example: mysql> grant all privileges on the db to be accessed. * to 'newuser' @ '%' indentified by 'Password'; then run the following command to restart mysql: $ service mysql restart
6) for other information, see 6-1) Mysql configuration file reading sequence:/etc/my. cnf/etc/mysql/my. cnf/usr/etc/my. cnf ~ /. My. cnf After the default installation, only the configuration file "/etc/mysql/my. cnf" 6-2) displays the history of Mysql command execution on the local machine :~ $ Cat. mysql_history6-3) modify the MySQL data file storage path: Modify/etc/mysql/my. cnf's datadir =/var/lib/mysql, the default path is/var/lib/mysql6-4) to modify the default port of MySQL: Modify/etc/mysql/my. cnf port = 3306, default port 33066-5) Modify MySQL administrator password: $ sudo mysqladmin-u root password newpassword6-6) install client: $ sudo apt-get install mysql-client6-7) check if the mysqld process is Enabled: $ pgrep mysqld, if the process is enabled, this command returns the id6-8 of the process) check if the MySQL server is running: $ Sudo netstat-tap | grep mysql When you run this command, you can see a line similar to the following: Tcp 0 0 localhost. localdomain: mysql *: * LISTEN- If the server cannot run properly, run the following command to start it: $ sudo/etc/init. d/mysql restart6-9) view the port used by the mysql service: $ sudo netstat-antup | grep mysql, which will output information similar to the following: tcp 0 0.0.0.0: 3306 0.0.0.0: * LISTEN 682/mysqld