Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu12.04

Source: Internet
Author: User
It was possible to install mysql in the source code of Ubuntu12.04 after following the tutorials on the official website step by step. However, after installing Python-MySQLdb, mysql would not work.

It was possible to install mysql in the source code of Ubuntu 12.04 after a step-by-step tutorial on the official website, but mysql won't work after Python-MySQLdb is installed.

I have been working on this for a few days. It was possible to install mysql in the source code of Ubuntu 12.04 following the tutorials on the official website step by step. However, after installing Python-MySQLdb, mysql would not work, when it is started, The "the MySQL server quit without updating The PID file (/usr/local/bin/mysql/data/XXXXX. pid "error or" MySQL server cannot be found (/usr/bin/mysqld_safe) "error.

Related reading:

Install MySQL in Ubuntu 12.04

Install MySQL 5.6.12 (Cmake compilation) in Linux source code)

Compile and install MySQL 5.5 Based on Cmake

Ubuntu uses Deb to install MySQL 5.5

It was later found that it was a/etc/mysql/my. the cnf file is generated after Python-MySQLdb is installed, unless you install mysql to copy the my-default.cnf to this location. The content of the/etc/mysql/my. cnf file after Python-MySQLdb is installed should be as follows:

#
# The MySQL database server configuration file.
#
# You can copy this to one:
#-"/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
# -- Print-defaults to see which it wocould actually understand and use.
#
# For explanations see
#

# This will be passed to all mysql clients
# It has been reported that passwords shoshould 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. sock

# Here is entries for some specific programs
# The following values assume you have at least 32 M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[Mysqld_safe]
Socket =/var/run/mysqld. sock
Nice = 0

[Mysqld]
#
# * Basic Settings
#
User = mysql
Pid-file =/var/run/mysqld. pid
Socket =/var/run/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 = 16 M
Max_allowed_packet = 16 M
Thread_stack = 192 K
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 = 1 M
Query_cache_size = 16 M
#
# * 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. log
# General_log = 1
#
# Error log-shoshould 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 = 100 M
# Binlog_do_db = include_database_name
# Binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10 MB datafile in/var/lib/mysql /.
# Read the manual for more InnoDB related options. There are done!
#
# * 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 = 16 M

[Mysql]
# No-auto-rehash # faster start of mysql but no tab completition

[Isamchk]
Key_buffer = 16 M

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.