Rumah pangkalan data tutorial mysql Ubuntu下安装MySQL5.6.23_MySQL

Ubuntu下安装MySQL5.6.23_MySQL

Jun 01, 2016 pm 01:01 PM

Ubuntu下安装MySQL 5.6.23
1.下载对应Linux-generic的源码包,解压,将解压后的文件夹重命名为mysql,移动到/usr/local目录下; tar –xzf mysql-5.6.23-linux-glibc2.5-x86_64.tar.gz mv mysql-5.6.23-linux-glibc2.5-x86_64 mysql sudo mv mysql /usr/local
2.创建用户mysql和组mysql vonzhou@de16-C6100: sudo groupadd mysql
vonzhou@de16-C6100: sudo useradd -r -g mysql mysql
3、进入mysql目录 vonzhou@de16-C6100: sudo cd /usr/local/mysql
4、将mysql文件夹own及grp变更为mysql vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R mysql . vonzhou@de16-C6100:/usr/local/mysql$ sudo chgrp -R mysql .

5、执行mysql安装脚本,设置用户
vonzhou@de16-C6100:/usr/local/mysql$ sudo ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables..../bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory vonzhou@de16-C6100:/usr/local/mysql$ sudo apt-get install libaio-dev
(..........)
vonzhou@de16-C6100:/usr/local/mysql$ sudo ./scripts/mysql_install_db --user=mysql
Installing MySQL system tables...2015-03-18 21:22:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-18 21:22:46 5284 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-03-18 21:22:46 5284 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-18 21:22:46 5284 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-03-18 21:22:46 5284 [Note] InnoDB: Memory barrier is not used
2015-03-18 21:22:46 5284 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-03-18 21:22:46 5284 [Note] InnoDB: Using Linux native AIO
2015-03-18 21:22:46 5284 [Note] InnoDB: Using CPU crc32 instructions
2015-03-18 21:22:46 5284 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-03-18 21:22:46 5284 [Note] InnoDB: Completed initialization of buffer pool
2015-03-18 21:22:46 5284 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2015-03-18 21:22:46 5284 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2015-03-18 21:22:46 5284 [Note] InnoDB: Database physically writes the file full: wait...
2015-03-18 21:22:46 5284 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2015-03-18 21:22:46 5284 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2015-03-18 21:22:47 5284 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2015-03-18 21:22:47 5284 [Warning] InnoDB: New log files created, LSN=45781
2015-03-18 21:22:47 5284 [Note] InnoDB: Doublewrite buffer not found: creating new
2015-03-18 21:22:47 5284 [Note] InnoDB: Doublewrite buffer created
2015-03-18 21:22:47 5284 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-18 21:22:47 5284 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-03-18 21:22:47 5284 [Note] InnoDB: Foreign key constraint system tables created
2015-03-18 21:22:47 5284 [Note] InnoDB: Creating tablespace and datafile system tables.
2015-03-18 21:22:47 5284 [Note] InnoDB: Tablespace and datafile system tables created.
2015-03-18 21:22:47 5284 [Note] InnoDB: Waiting for purge to start
2015-03-18 21:22:48 5284 [Note] InnoDB: 5.6.23 started; log sequence number 0
2015-03-18 21:22:52 5284 [Note] Binlog end
2015-03-18 21:22:52 5284 [Note] InnoDB: FTS optimize thread exiting.
2015-03-18 21:22:52 5284 [Note] InnoDB: Starting shutdown...
2015-03-18 21:22:53 5284 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2015-03-18 21:22:53 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-03-18 21:22:53 5307 [Note] InnoDB: Using atomics to ref count buffer pool pages
2015-03-18 21:22:53 5307 [Note] InnoDB: The InnoDB memory heap is disabled
2015-03-18 21:22:53 5307 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2015-03-18 21:22:53 5307 [Note] InnoDB: Memory barrier is not used
2015-03-18 21:22:53 5307 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-03-18 21:22:53 5307 [Note] InnoDB: Using Linux native AIO
2015-03-18 21:22:53 5307 [Note] InnoDB: Using CPU crc32 instructions
2015-03-18 21:22:53 5307 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2015-03-18 21:22:53 5307 [Note] InnoDB: Completed initialization of buffer pool
2015-03-18 21:22:53 5307 [Note] InnoDB: Highest supported file format is Barracuda.
2015-03-18 21:22:53 5307 [Note] InnoDB: 128 rollback segment(s) are active.
2015-03-18 21:22:53 5307 [Note] InnoDB: Waiting for purge to start
2015-03-18 21:22:53 5307 [Note] InnoDB: 5.6.23 started; log sequence number 1625977
2015-03-18 21:22:53 5307 [Note] Binlog end
2015-03-18 21:22:53 5307 [Note] InnoDB: FTS optimize thread exiting.
2015-03-18 21:22:53 5307 [Note] InnoDB: Starting shutdown...
2015-03-18 21:22:55 5307 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

./bin/mysqladmin -u root password 'new-password'
./bin/mysqladmin -u root -h de16-C6100 password 'new-password'

Alternatively you can run:

./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file ./my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as ./my-new.cnf,
please compare it with your file and take the changes you need. 6.上述步骤安装完成后,把该目录的所有权变更回来,除了data目录可以供我们普通用户操作; vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R root .
vonzhou@de16-C6100:/usr/local/mysql$ sudo chown -R mysql data
7. 可以改变默认配置文件的位置; vonzhou@de16-C6100:/usr/local/mysql$ sudo cp support-files/my-default.cnf /etc/my.cnf
8.后台启动mysql server;
vonzhou@de16-C6100:/usr/local/mysql$ sudo bin/mysqld_safe --user=mysql &
[1] 5375
vonzhou@de16-C6100:/usr/local/mysql$ 150318 21:29:24 mysqld_safe Logging to '/usr/local/mysql/data/de16-C6100.err'.
150318 21:29:24 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

9. 设置MySQL root权限的密码;
vonzhou@de16-C6100:/usr/local/mysql$ sudo bin/mysqladmin -u root password '你的密码'
Warning: Using a password on the command line interface can be insecure.
10. 把执行脚本移到init.d目录下;
vonzhou@de16-C6100:/usr/local/mysql$ sudo cp support-files/mysql.server /etc/init.d/mysql.server
11.此时可以查看运行状态,可以用service命令的status/start/stop/restart控制;
vonzhou@de16-C6100:/usr/local/mysql$ sudo service mysql.server status
* MySQL running (5477)
12.设置开机启动(就是插入到那些开机会自动运行的脚本中),取消自启动的话defaults -> remove ;
vonzhou@de16-C6100:/usr/local/mysql$ sudo update-rc.d mysql.server defaults
Adding system startup for /etc/init.d/mysql.server ...
/etc/rc0.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc1.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc6.d/K20mysql.server -> ../init.d/mysql.server
/etc/rc2.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc3.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc4.d/S20mysql.server -> ../init.d/mysql.server
/etc/rc5.d/S20mysql.server -> ../init.d/mysql.server
13.搞个符号连接,方便命令的输入;
vonzhou@de16-C6100:/usr/local/mysql$ sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
14. 此时,就按照好了,可以简单测试下。 vonzhou@de16-C6100:/usr/local/mysql$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.23 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)

mysql> exit
Bye

Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn

Alat AI Hot

Undresser.AI Undress

Undresser.AI Undress

Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover

AI Clothes Remover

Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Undress AI Tool

Undress AI Tool

Gambar buka pakaian secara percuma

Clothoff.io

Clothoff.io

Penyingkiran pakaian AI

AI Hentai Generator

AI Hentai Generator

Menjana ai hentai secara percuma.

Artikel Panas

R.E.P.O. Kristal tenaga dijelaskan dan apa yang mereka lakukan (kristal kuning)
2 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Tetapan grafik terbaik
2 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Cara Memperbaiki Audio Jika anda tidak dapat mendengar sesiapa
2 minggu yang lalu By 尊渡假赌尊渡假赌尊渡假赌

Alat panas

Notepad++7.3.1

Notepad++7.3.1

Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina

SublimeText3 versi Cina

Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1

Hantar Studio 13.0.1

Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6

Dreamweaver CS6

Alat pembangunan web visual

SublimeText3 versi Mac

SublimeText3 versi Mac

Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Bagaimana anda mengubah jadual di MySQL menggunakan pernyataan Alter Table? Bagaimana anda mengubah jadual di MySQL menggunakan pernyataan Alter Table? Mar 19, 2025 pm 03:51 PM

Artikel ini membincangkan menggunakan pernyataan jadual Alter MySQL untuk mengubah suai jadual, termasuk menambah/menjatuhkan lajur, menamakan semula jadual/lajur, dan menukar jenis data lajur.

Bagaimana saya mengkonfigurasi penyulitan SSL/TLS untuk sambungan MySQL? Bagaimana saya mengkonfigurasi penyulitan SSL/TLS untuk sambungan MySQL? Mar 18, 2025 pm 12:01 PM

Artikel membincangkan mengkonfigurasi penyulitan SSL/TLS untuk MySQL, termasuk penjanaan sijil dan pengesahan. Isu utama menggunakan implikasi keselamatan sijil yang ditandatangani sendiri. [Kira-kira aksara: 159]

Bagaimana anda mengendalikan dataset besar di MySQL? Bagaimana anda mengendalikan dataset besar di MySQL? Mar 21, 2025 pm 12:15 PM

Artikel membincangkan strategi untuk mengendalikan dataset besar di MySQL, termasuk pembahagian, sharding, pengindeksan, dan pengoptimuman pertanyaan.

Apakah beberapa alat GUI MySQL yang popular (mis., MySQL Workbench, phpmyadmin)? Apakah beberapa alat GUI MySQL yang popular (mis., MySQL Workbench, phpmyadmin)? Mar 21, 2025 pm 06:28 PM

Artikel membincangkan alat MySQL GUI yang popular seperti MySQL Workbench dan PHPMyAdmin, membandingkan ciri dan kesesuaian mereka untuk pemula dan pengguna maju. [159 aksara]

Bagaimana anda menjatuhkan jadual di MySQL menggunakan pernyataan jadual drop? Bagaimana anda menjatuhkan jadual di MySQL menggunakan pernyataan jadual drop? Mar 19, 2025 pm 03:52 PM

Artikel ini membincangkan jadual menjatuhkan di MySQL menggunakan pernyataan Jadual Drop, menekankan langkah berjaga -jaga dan risiko. Ia menyoroti bahawa tindakan itu tidak dapat dipulihkan tanpa sandaran, memperincikan kaedah pemulihan dan bahaya persekitaran pengeluaran yang berpotensi.

Bagaimana anda mewakili hubungan menggunakan kunci asing? Bagaimana anda mewakili hubungan menggunakan kunci asing? Mar 19, 2025 pm 03:48 PM

Artikel membincangkan menggunakan kunci asing untuk mewakili hubungan dalam pangkalan data, memberi tumpuan kepada amalan terbaik, integriti data, dan perangkap umum untuk dielakkan.

Bagaimana anda membuat indeks pada lajur JSON? Bagaimana anda membuat indeks pada lajur JSON? Mar 21, 2025 pm 12:13 PM

Artikel ini membincangkan membuat indeks pada lajur JSON dalam pelbagai pangkalan data seperti PostgreSQL, MySQL, dan MongoDB untuk meningkatkan prestasi pertanyaan. Ia menerangkan sintaks dan faedah mengindeks laluan JSON tertentu, dan menyenaraikan sistem pangkalan data yang disokong.

Bagaimanakah saya menjamin MySQL terhadap kelemahan biasa (suntikan SQL, serangan kekerasan)? Bagaimanakah saya menjamin MySQL terhadap kelemahan biasa (suntikan SQL, serangan kekerasan)? Mar 18, 2025 pm 12:00 PM

Artikel membincangkan mendapatkan MySQL terhadap suntikan SQL dan serangan kekerasan menggunakan pernyataan yang disediakan, pengesahan input, dan dasar kata laluan yang kuat. (159 aksara)

See all articles