当前位置: 技术问答>linux和unix
ubuntu下安装mysql的问题
来源: 互联网 发布时间:2017-02-15
本文导语: 一直想通过apt-get install自动安装mysql 但是总是存在依赖关系 不知道是不是没有找到问题的关键地方还是怎么,但是现在的问题貌似是在libdbi-perl上 不能自动安装 在新立得上安装也是有这个问题 怎么解决啊 很着急 ...
一直想通过apt-get install自动安装mysql
但是总是存在依赖关系
不知道是不是没有找到问题的关键地方还是怎么,但是现在的问题貌似是在libdbi-perl上 不能自动安装
在新立得上安装也是有这个问题
怎么解决啊 很着急 谢谢大家
问题大致如下
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-server-5.0 : Depends: libdbi-perl but it is not going to be installed
Depends: mysql-client-5.0 (>= 5.0.95-0ubuntu1) but it is not going to be installed
E: Broken packages
chen@ubuntu:~/Desktop$ sudo aptitude install libdbi-perl
但是总是存在依赖关系
不知道是不是没有找到问题的关键地方还是怎么,但是现在的问题貌似是在libdbi-perl上 不能自动安装
在新立得上安装也是有这个问题
怎么解决啊 很着急 谢谢大家
问题大致如下
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-server-5.0 : Depends: libdbi-perl but it is not going to be installed
Depends: mysql-client-5.0 (>= 5.0.95-0ubuntu1) but it is not going to be installed
E: Broken packages
chen@ubuntu:~/Desktop$ sudo aptitude install libdbi-perl
|
=。= 咱一直觉得如果不是批量安装的话,用apt这种东西纯粹是自找麻烦...tar包要方便得多...
groupadd mysql
useradd -g mysql -s "/sbin/nologin" mysql
tar zxvf mysql-5.1.58.tar.gz
cd mysql-5.1.58
./configure --prefix=/usr/local/mysql --localstatedir=/home/mysql --with-charset=gbk --with-extra-charsets=all --enable-thread-safe-client --with-plugins=partition,innobase,myisam,innodb_plugin,myisammrg,heap
make
make install
chown mysql:mysql -R /usr/local/mysql/
cd ../
#安装完毕....
#修改配置
cp support-files/my-medium.cnf /etc/my.cnf
#初始化数据库
/usr/local/mysql/bin/mysql_install_db --user=mysql
#添加为服务:
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/mysql/
#启动mysql
/etc/init.d/mysqld start
#连接mysql
/usr/local/mysql/bin/mysql
#在mysql中,修改密码以及授权访问
grant all privileges on *.* to root@'localhost' identified by '密码';
grant all privileges on *.* to root@'127.0.0.1' identified by '密码';
use mysql;
delete from user where password = "";
select host,user,password from user;
exit
结束
groupadd mysql
useradd -g mysql -s "/sbin/nologin" mysql
tar zxvf mysql-5.1.58.tar.gz
cd mysql-5.1.58
./configure --prefix=/usr/local/mysql --localstatedir=/home/mysql --with-charset=gbk --with-extra-charsets=all --enable-thread-safe-client --with-plugins=partition,innobase,myisam,innodb_plugin,myisammrg,heap
make
make install
chown mysql:mysql -R /usr/local/mysql/
cd ../
#安装完毕....
#修改配置
cp support-files/my-medium.cnf /etc/my.cnf
#初始化数据库
/usr/local/mysql/bin/mysql_install_db --user=mysql
#添加为服务:
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig --level 2345 mysqld on
chown mysql:mysql -R /usr/local/mysql/
#启动mysql
/etc/init.d/mysqld start
#连接mysql
/usr/local/mysql/bin/mysql
#在mysql中,修改密码以及授权访问
grant all privileges on *.* to root@'localhost' identified by '密码';
grant all privileges on *.* to root@'127.0.0.1' identified by '密码';
use mysql;
delete from user where password = "";
select host,user,password from user;
exit
结束
|
这种做法完全破坏了linux发行版,发行版软件仓库的主要目的并不是简化软件安装,而是提供一个可信任的软件来源和通常能保证正确的软件配置
特别是服务器组件,稳定性很重要,服务器上应该禁止出现任何手动编译安装的软件,除非软件仓库确实没有
|
"aptitude"
使用这个工具,当某个库依赖的库与当前版本不一致时,aptitude 会尝试降级当前这个库的版本,同时解决降级这个库对其它软件的依赖性的影响, 最终成功安装apt-get 没法安装的软件
如:#aptitude install mysql-client-5.1
使用这个工具,当某个库依赖的库与当前版本不一致时,aptitude 会尝试降级当前这个库的版本,同时解决降级这个库对其它软件的依赖性的影响, 最终成功安装apt-get 没法安装的软件
如:#aptitude install mysql-client-5.1
|
不能单独先安装libdbi-perl库?
|
apt-get本身就能自动处理依赖,又不是dpkg
前提你要联网,才能把需要的包全部下下来
Debian系对网络依赖极为严重
前提你要联网,才能把需要的包全部下下来
Debian系对网络依赖极为严重