首页 > 代码库 > ubuntu16.xxx安装mysql5.0项目迁移环境搭建
ubuntu16.xxx安装mysql5.0项目迁移环境搭建
简述:此次主要是因为搬迁机房,原来一台09年的ubuntu安装的9.x的系统,后来升级过内核为10.x,上面服务配置混乱需要整理,领导想要升级系统,重装跟以前服务器上一样的软件。由于年代久远,现在系统升级为16.x比较难找到老版本source.list源,试过离线自己做本地源,依赖解决不了,最后再国外找到一个比较全的源。安装完成后,mysql没有配置文件,自己手动自定义有问题,最后经过查找帮助配置文件,解决,具体如下
[client] port = 3306 socket = /var/run/mysqld/mysqld.sock default-character-set=utf8 [mysqld] port = 3306 socket = /var/run/mysqld/mysqld.sock
#一、不能创建mysqld.pid
#与my-innodb-heavy-4G.cnf比较,一定要修改成上面不然老是报错
#[ERROR] /usr/sbin/mysqld: Can‘t create/write to file ‘/var/run/mysqld/mysqld.pid‘ (Errcode: 13)
#[ERROR] Can‘t start server: can‘t create PID file: Permission denied
skip-external-locking default-character-set=utf8 init_connect=‘SET NAMES utf8‘ key_buffer = 16M max_allowed_packet = 4M thread_stack = 256K thread_cache_size = 128 table_cache = 1024 thread_concurrency = 10 sort_buffer_size = 6M read_buffer_size = 4M join_buffer_size = 8M myisam_sort_buffer_size = 16M tmp_table_size = 128M query_cache_limit = 4M query_cache_size =32M set-variable = innodb_buffer_pool_size= 4G set-variable = innodb_additional_mem_pool_size=64M myisam-recover = BACKUP max_connections = 1000 expire_logs_days = 10 max_binlog_size = 100M skip-federated
#二、链接文件修改配置文件错误
#另外注意这几个文件的连接情况
root@ubuntu16-slyey:/etc/mysql# ls -al /etc/mysql/my.cnf.fallback -rwxr-xr-x 1 root root 833 Jan 11 15:17 /etc/mysql/my.cnf.fallback root@ubuntu16-slyey:/etc/mysql# ls -al /etc/alternatives/my.cnf.fallback lrwxrwxrwx 1 root root 26 Jan 11 14:56 /etc/alternatives/my.cnf.fallback -> /etc/mysql/my.cnf.fallback root@ubuntu16-slyey:/etc/mysql# ls -al /etc/mysql/my.cnf lrwxrwxrwx 1 root root 33 Jan 11 13:43 /etc/mysql/my.cnf -> /etc/alternatives/my.cnf.fallback
#三、排错方法
#重要的排错方法
#systemctl status mysql.service #查看状态信息
#journalctl -xe #查看具体错误信息
#四、mysql帮助文档查看,最后找到解决方法
#dpkg -L softname #dpkg -s softname #dpkg -S softname #aptitude #apt-file list softname #/usr/share/doc/mysql-server-5.0/examples/my-large.cnf.gz #/usr/share/doc/mysql-server-5.0/examples/my-small.cnf #/usr/share/doc/mysql-server-5.0/examples/ndb_mgmd.cnf #/usr/share/doc/mysql-server-5.0/examples/my-huge.cnf.gz #/usr/share/doc/mysql-server-5.0/examples/my-innodb-heavy-4G.cnf.gz
#我是通过my-innodb-heavy-4G.cnf.gz这个文件来修改的
本文出自 “天涯海角” 博客,请务必保留此出处http://1983939925.blog.51cto.com/8400375/1891103
ubuntu16.xxx安装mysql5.0项目迁移环境搭建