现在的位置: 首页 > 综合 > 正文

MySql install in Ubuntu

2014年11月10日 ⁄ 综合 ⁄ 共 7856字 ⁄ 字号 评论关闭

 

1.安装mysql(以root用户操作)
root@vinco:~# 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-common mysql-server-5.1
  mysql-server-core-5.1
Suggested packages:
  dbishell libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-server mysql-server-5.1 mysql-server-core-5.1
The following packages will be upgraded:
  libmysqlclient16 mysql-common
2 upgraded, 9 newly installed, 0 to remove and 343 not upgraded.
Need to get 22.4MB of archives.
After this operation, 48.8MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://cn.archive.ubuntu.com karmic-updates/main mysql-common 5.1.37-1ubuntu5.5 [71.2kB]
Get:2 http://cn.archive.ubuntu.com karmic/main libnet-daemon-perl 0.43-1 [46.9kB]
Get:3 http://cn.archive.ubuntu.com karmic/main libplrpc-perl 0.2020-2 [36.0kB]                                                                                         
Get:4 http://cn.archive.ubuntu.com karmic/main libdbi-perl 1.609-1 [800kB]                                                                                             
Get:5 http://cn.archive.ubuntu.com karmic-updates/main libmysqlclient16 5.1.37-1ubuntu5.5 [1,904kB]                                                                    
Get:6 http://cn.archive.ubuntu.com karmic/main libdbd-mysql-perl 4.011-1ubuntu1 [136kB]                                                                                
Get:7 http://cn.archive.ubuntu.com karmic-updates/main mysql-client-5.1 5.1.37-1ubuntu5.5 [8,210kB]                                                                    
Get:8 http://cn.archive.ubuntu.com karmic-updates/main mysql-server-core-5.1 5.1.37-1ubuntu5.5 [3,841kB]                                                               
Get:9 http://cn.archive.ubuntu.com karmic-updates/main mysql-server-5.1 5.1.37-1ubuntu5.5 [7,187kB]                                                                    
Get:10 http://cn.archive.ubuntu.com karmic/main libhtml-template-perl 2.9-1 [65.8kB]                                                                                   
Get:11 http://cn.archive.ubuntu.com karmic-updates/main mysql-server 5.1.37-1ubuntu5.5 [65.5kB]                                                                        
Fetched 22.4MB in 25min 21s (14.7kB/s)                                                                                                                                 
Preconfiguring packages ...
(Reading database ... 122259 files and directories currently installed.)
Preparing to replace mysql-common 5.1.37-1ubuntu5 (using .../mysql-common_5.1.37-1ubuntu5.5_all.deb) ...
Unpacking replacement mysql-common ...
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.609-1_i386.deb) ...
Preparing to replace libmysqlclient16 5.1.37-1ubuntu5 (using .../libmysqlclient16_5.1.37-1ubuntu5.5_i386.deb) ...
Unpacking replacement libmysqlclient16 ...
Selecting previously deselected package libdbd-mysql-perl.
Unpacking libdbd-mysql-perl (from .../libdbd-mysql-perl_4.011-1ubuntu1_i386.deb) ...
Selecting previously deselected package mysql-client-5.1.
Unpacking mysql-client-5.1 (from .../mysql-client-5.1_5.1.37-1ubuntu5.5_i386.deb) ...
Selecting previously deselected package mysql-server-core-5.1.
Unpacking mysql-server-core-5.1 (from .../mysql-server-core-5.1_5.1.37-1ubuntu5.5_i386.deb) ...
Processing triggers for man-db ...
Setting up mysql-common (5.1.37-1ubuntu5.5) ...
Selecting previously deselected package mysql-server-5.1.
(Reading database ... 122591 files and directories currently installed.)
Unpacking mysql-server-5.1 (from .../mysql-server-5.1_5.1.37-1ubuntu5.5_i386.deb) ...
Selecting previously deselected package libhtml-template-perl.
Unpacking libhtml-template-perl (from .../libhtml-template-perl_2.9-1_all.deb) ...
Selecting previously deselected package mysql-server.
Unpacking mysql-server (from .../mysql-server_5.1.37-1ubuntu5.5_all.deb) ...
Processing triggers for sreadahead ...
Processing triggers for man-db ...
Setting up libnet-daemon-perl (0.43-1) ...
Setting up libplrpc-perl (0.2020-2) ...
Setting up libdbi-perl (1.609-1) ...
Setting up libmysqlclient16 (5.1.37-1ubuntu5.5) ...

Setting up libdbd-mysql-perl (4.011-1ubuntu1) ...
Setting up mysql-client-5.1 (5.1.37-1ubuntu5.5) ...

Setting up mysql-server-core-5.1 (5.1.37-1ubuntu5.5) ...
Setting up mysql-server-5.1 (5.1.37-1ubuntu5.5) ...
 * Stopping MySQL database server mysqld                                                                                                                         [ OK ]

110721 20:41:44 [Note] Plugin 'FEDERATED' is disabled.
110721 20:41:45  InnoDB: Started; log sequence number 0 44233
110721 20:41:45  InnoDB: Starting shutdown...
110721 20:41:46  InnoDB: Shutdown completed; log sequence number 0 44233
110721 20:41:46 [Warning] Forcing shutdown of 1 plugins
 * Starting MySQL database server mysqld                                                                                                                         [ OK ]

 * Checking for corrupt, not cleanly closed and upgrade needing tables.

Setting up libhtml-template-perl (2.9-1) ...
Setting up mysql-server (5.1.37-1ubuntu5.5) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
root@vinco:/etc/apache2/sites-available# apt-get install libapache2-mode-auth-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Couldn't find package libapache2-mode-auth-mysql
root@vinco:/etc/apache2/sites-available# apt-get install libapache2-mod-auth-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libapache2-mod-auth-mysql
0 upgraded, 1 newly installed, 0 to remove and 343 not upgraded.
Need to get 25.3kB of archives.
After this operation, 111kB of additional disk space will be used.
Err http://cn.archive.ubuntu.com karmic/main libapache2-mod-auth-mysql 4.3.9-11ubuntu1
  Could not resolve 'cn.archive.ubuntu.com'
Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/m/mod-auth-mysql/libapache2-mod-auth-mysql_4.3.9-11ubuntu1_i386.deb  Could not resolve 'cn.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@vinco:/etc/apache2/sites-available# apt-get install libapache2-mod-auth-mysql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libapache2-mod-auth-mysql
0 upgraded, 1 newly installed, 0 to remove and 343 not upgraded.
Need to get 25.3kB of archives.
After this operation, 111kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com karmic/main libapache2-mod-auth-mysql 4.3.9-11ubuntu1 [25.3kB]
Fetched 25.3kB in 15s (1,652B/s)                                                                                                                                       
Selecting previously deselected package libapache2-mod-auth-mysql.
(Reading database ... 122687 files and directories currently installed.)
Unpacking libapache2-mod-auth-mysql (from .../libapache2-mod-auth-mysql_4.3.9-11ubuntu1_i386.deb) ...
Setting up libapache2-mod-auth-mysql (4.3.9-11ubuntu1) ...
root@vinco:~#

2.配置mysql
root@vinco:~# vim  /etc/mysql/my.cnf
bind-address 127.0.0.1 默认是只允许本地访问数据库,如果有需要其他机器访问 把这句话用#注释掉
#bind-address 127.0.0.1

 

3.重启Mysql

root@vinco:~# /etc/init.d/mysql restart
 * Stopping MySQL database server mysqld                                                                                                                         [ OK ]

 * Starting MySQL database server mysqld                                                                                                                         [ OK ]

 * Checking for corrupt, not cleanly closed and upgrade needing tables.
root@vinco:~#

 

抱歉!评论已关闭.