1. Ubuntu install MySQL Required Software Package sudoapt-getinstallbinutilscppfetchmailflexgcclibarchive-zip-perllibc6-devlibcompre
1. Ubuntu install MySQL required package sudo apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompre
1. Install the required MySQL software package in Ubuntu
Sudo apt-get install binutils cpp fetchmail flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl libdb4.3-dev libpcre3 libpopt-dev lynx m4 make ncftp nmap perl-modules unzip zip zlib1g-dev autoconf automake1.9 libtool bison autotools-dev g ++ build-essential
2. Install libncurses5-dev
Sudo apt-get install libncurses5-dev
When the software is compiled and installed through the source code, the following error occurs:
Checking for termcap functions library... Configure: error: No curses/termcap library found
Install the libncurses5-dev library.
3. Install MySQL
Mysql uses UTF-8 as the default encoding:
Groupadd mysql
Useradd-g mysql
Tar-zxvf mysql-5.0.45.tar.gz
Cd mysql-5.0.45
./Configure-prefix =/usr/local/mysql-with-charset = utf8-with-collation = utf8_general_ci-with-extra-charsets = latin1
Make
Make install
Vi my. cnf
Enter the code:
[Client]
Default-character-set = utf8
Port = 3306
Socket =/tmp/mysql. sock
[Mysql]
Prompt = "(\ u: Molutran's MySQL Server :) [\ d]>"
No-auto-rehash
[Mysqld]
# Default-character-set = utf8
User = mysql
Port = 3306
Socket =/tmp/mysql. sock
Basedir =/usr/local/mysql
Datadir =/usr/local/mysql/data
Open_files_limit = 10240
Back_log = 600
Max_connections = 3000
Max_connect_errorrs = 6000
Table_cache = 614
External-locking = FALSE
Max_allowed_packet = 32 M
Sort_buffer_size = 2 M
Join_buffer_size = 2 M
Thread _ cache_size = 300
Thread_concurrency = 8
Query_cache_size = 32 M
Query_cache_limit = 2 M
Query_cache_min_res_unit = 2 k
Default-storage-engine = MyISAM
Default_table_type = MyISAM
Thread_stack = 192 K
Transaction_isolation = READ-COMMITTED
Tmp_table_size = 246 M
Max_heap_table_size = 246 M
Long_query_time = 1
Log_long_format
Log-bin =/usr/local/mysql/binlog
Binlog_cache_size = 4 M
Binlog_format = MIXED
Max_binlog_cache_size = 8 M
Max_binlog_size = 512 M
Expire_logs_days = 7
Key_buffer_size = 256 M
Read_buffer_size = 1 M
Read_rnd_buffer_size = 16 M
Bulk_insert_buffer_size = 64 M
Myisam_sort_buffer_size = 128 M
Myisam_max_sort_file_size = 10G
Myisam_max_extra_sort_file_size = 10G
Myisam_repair_threads = 1
Myisam_recover
Skip-name-resolve
Master-connect-retry = 10
Slave-skip-errors = 1396
Server-id = 1
Innodb_additional_mem_pool_size = 16 M
Innodb_buffer_pool_size = 2048 M
Innodb_data_file_path = ibdata1: 1024 M: autoextend
Innodb_file_io_threads = 4
Innodb_thread_concurrency = 8
Innodb_flush_log_at_trx_commit = 2
Innodb_log_buffer_size = 16 M
Innodb_log_file_size = 128 M
Innodb_log_files_in_group = 3
Innodb_max_dirty_pages_pct = 90
Innodb_lock_wait_timeout = 120
Innodb_file_per_table = 0
[Mysqldump]
Quick
Max_allowed_packet = 32 M
4. Add write permission to the MySQL installation directory and change the group
Chmod + w/usr/local/mysql
Chown-R mysql: mysql/usr/local/mysql
5. Modify the root user password
Mysql> use mysql
Mysql> UPDATE user SET password = PASSWORD ('new _ password') WHERE user = 'root ';
Mysql> flush privileges;
Mysql> exit