您好,欢迎访问一九零五行业门户网

Ubuntu 12.04下源代码安装MySQL5.6以及Python-MySQLdb

本来根据官网的教程一步一步下来之后ubuntu 12.04下源代码安装mysql是可以的,但是在安装了python-mysqldb之后发现mysql就不行了
前几天一直在弄这个。本来根据官网的教程一步一步下来之后ubuntu 12.04下源代码安装mysql是可以的,,但是在安装了python-mysqldb之后发现mysql就不行了,已启动就会出现“the mysql server quit without updating the pid file(/usr/local/bin/mysql/data/xxxxx.pid错误或者出现”mysql server cannot be found(/usr/bin/mysqld_safe)“错误。
相关阅读:
ubuntu 12.04下安装mysql图解 
linux源码安装mysql 5.6.12 (cmake编译)
基于cmake编译安装mysql 5.5 
ubuntu 通过deb 安装 mysql 5.5 
后来发现是一个/etc/mysql/my.cnf这个文件导致的,这个文件是安装了python-mysqldb之后才会出现的,除非你安装mysql是把my-default.cnf拷贝到这个位置了。安装好后python-mysqldb之后的/etc/mysql/my.cnf文件的内容应该如下:
#
# the mysql database server configuration file.
#
# you can copy this to one of:
# - /etc/mysql/my.cnf to set global options,
# - ~/.my.cnf to set user-specific options.
#
# one can use all long options that the program supports.
# run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# for explanations see
#
# this will be passed to all mysql clients
# it has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain # chars...
# remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port        = 3306
socket        = /var/run/mysqld/mysqld.sock
# here is entries for some specific programs
# the following values assume you have at least 32m ram
# this was formally known as [safe_mysqld]. both versions are currently parsed.
[mysqld_safe]
socket        = /var/run/mysqld/mysqld.sock
nice        = 0
[mysqld]
#
# * basic settings
#
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket        = /var/run/mysqld/mysqld.sock
port        = 3306
basedir        = /usr
datadir        = /var/lib/mysql
tmpdir        = /tmp
lc-messages-dir    = /usr/share/mysql
skip-external-locking
#
# instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 127.0.0.1
#
# * fine tuning
#
key_buffer        = 16m
max_allowed_packet    = 16m
thread_stack        = 192k
thread_cache_size      = 8
# this replaces the startup script and checks myisam tables if needed
# the first time they are touched
myisam-recover        = backup
#max_connections        = 100
#table_cache            = 64
#thread_concurrency    = 10
#
# * query cache configuration
#
query_cache_limit    = 1m
query_cache_size        = 16m
#
# * logging and replication
#
# both location gets rotated by the cronjob.
# be aware that this log type is a performance killer.
# as of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log            = 1
#
# error log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# here you can see queries with especially long duration
#log_slow_queries    = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# the following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see readme.debian about
#      other settings you may need to change.
#server-id        = 1
#log_bin            = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size        = 100m
#binlog_do_db        = include_database_name
#binlog_ignore_db    = include_database_name
#
# * innodb
#
# innodb is enabled by default with a 10mb datafile in /var/lib/mysql/.
# read the manual for more innodb related options. there are many!
#
# * security features
#
# read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# for generating ssl certificates i recommend the openssl gui tinyca.
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
[mysqldump]
quick
quote-names
max_allowed_packet    = 16m
[mysql]
#no-auto-rehash    # faster start of mysql but no tab completition
[isamchk]
key_buffer        = 16m
其它类似信息

推荐信息