検索
ホームページデータベースmysql チュートリアルMySQL 5.6.19 二进制的安装方式_MySQL

1.        操作系统

CentOS release 6.2 (Final)

 

2.        创建用户和组

[root@mymaster1 ~]# groupadd mysql

[root@mymaster1 ~]# useradd -r -g mysqlmysql

 

3.        解压安装包(解压到你想存储数据库数据的地方)

[root@mymaster1 ~]# cd /data

[root@mymaster1 data]# tar -xzvf /root/mysql_soft/mysql-5.6.19-linux-glibc2.5-x86_64.tar.gz

[root@mymaster1 data]# ln -s mysql-5.6.19-linux-glibc2.5-x86_64 mysql

 

4.        查看解压情况

[root@mymaster1 data]# ll

总用量 20

lrwxrwxrwx.  1 root root   34  6月 27 15:31 mysql -> mysql-5.6.19-linux-glibc2.5-x86_64

drwxr-xr-x. 13 rootroot  4096  6月 27 15:31 mysql-5.6.19-linux-glibc2.5-x86_64

 

5.        修改文件夹所属用户和组为mysql:

[root@mymaster1 data]# cd mysql

[root@mymaster1 mysql]# chown -R mysql:mysql .

 

6.        安装数据库,数据存放目录为/data/mysql/data

[root@mymaster1 mysql]#scripts/mysql_install_db --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data

WARNING: The host'mymaster1.localdomain' could not be looked up with /data/mysql/bin/resolveip.

This probably means thatyour libc libraries are not 100 % compatible

with this binary MySQLversion. The MySQL daemon, mysqld, should work

normally with the exceptionthat host name resolving will not work.

This means that youshould use IP addresses instead of hostnames

when specifying MySQLprivileges !

 

当出现上面警告时,解决方法是:在/etc/hosts配置文件中增加IP地址和主机名的映射

[root@mymaster1 Packages]# cat /etc/hosts

127.0.0.1  localhost localhost.localdomain localhost4 localhost4.localdomain4

::1        localhost localhost.localdomain localhost6 localhost6.localdomain6

IP地址  mymaster1.localdomain

 

正确的提示信息如下:

[root@mymaster1 mysql]#scripts/mysql_install_db --user=mysql --basedir=/data/mysql --datadir=/data/mysql/data

Installing MySQL system tables...2014-06-2716:02:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated.Please use --explicit_defaults_for_timestamp server option (see documentationfor more details).

2014-06-27 16:02:45 2134 [Note] InnoDB:Using atomics to ref count buffer pool pages

2014-06-27 16:02:45 2134 [Note] InnoDB: TheInnoDB memory heap is disabled

2014-06-27 16:02:45 2134 [Note] InnoDB:Mutexes and rw_locks use GCC atomic builtins

2014-06-27 16:02:45 2134 [Note] InnoDB:Compressed tables use zlib 1.2.3

2014-06-27 16:02:45 2134 [Note] InnoDB:Using Linux native AIO

2014-06-27 16:02:45 2134 [Note] InnoDB:Using CPU crc32 instructions

2014-06-27 16:02:45 2134 [Note] InnoDB:Initializing buffer pool, size = 128.0M

2014-06-27 16:02:45 2134 [Note] InnoDB:Completed initialization of buffer pool

2014-06-27 16:02:45 2134 [Note] InnoDB: Thefirst specified data file ./ibdata1 did not exist: a new database to becreated!

2014-06-27 16:02:45 2134 [Note] InnoDB:Setting file ./ibdata1 size to 12 MB

2014-06-27 16:02:45 2134 [Note] InnoDB:Database physically writes the file full: wait...

2014-06-27 16:02:45 2134 [Note] InnoDB:Setting log file ./ib_logfile101 size to 48 MB

2014-06-27 16:02:46 2134 [Note] InnoDB:Setting log file ./ib_logfile1 size to 48 MB

2014-06-27 16:02:46 2134 [Note] InnoDB:Renaming log file ./ib_logfile101 to ./ib_logfile0

2014-06-27 16:02:46 2134 [Warning] InnoDB:New log files created, LSN=45781

2014-06-27 16:02:46 2134 [Note] InnoDB:Doublewrite buffer not found: creating new

2014-06-27 16:02:46 2134 [Note] InnoDB:Doublewrite buffer created

2014-06-27 16:02:46 2134 [Note] InnoDB: 128rollback segment(s) are active.

2014-06-27 16:02:46 2134 [Warning] InnoDB:Creating foreign key constraint system tables.

2014-06-27 16:02:46 2134 [Note] InnoDB:Foreign key constraint system tables created

2014-06-27 16:02:46 2134 [Note] InnoDB:Creating tablespace and datafile system tables.

2014-06-27 16:02:46 2134 [Note] InnoDB:Tablespace and datafile system tables created.

2014-06-27 16:02:46 2134 [Note] InnoDB:Waiting for purge to start

2014-06-27 16:02:46 2134 [Note] InnoDB:5.6.19 started; log sequence number 0

2014-06-27 16:02:47 2134 [Note] Binlog end

2014-06-27 16:02:47 2134 [Note] InnoDB: FTSoptimize thread exiting.

2014-06-27 16:02:47 2134 [Note] InnoDB:Starting shutdown...

2014-06-27 16:02:48 2134 [Note] InnoDB:Shutdown completed; log sequence number 1625977

OK

 

Filling help tables...2014-06-27 16:02:48 0[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).

2014-06-27 16:02:48 2157 [Note] InnoDB:Using atomics to ref count buffer pool pages

2014-06-27 16:02:48 2157 [Note] InnoDB: TheInnoDB memory heap is disabled

2014-06-27 16:02:48 2157 [Note] InnoDB:Mutexes and rw_locks use GCC atomic builtins

2014-06-27 16:02:48 2157 [Note] InnoDB:Compressed tables use zlib 1.2.3

2014-06-27 16:02:48 2157 [Note] InnoDB:Using Linux native AIO

2014-06-27 16:02:48 2157 [Note] InnoDB:Using CPU crc32 instructions

2014-06-27 16:02:48 2157 [Note] InnoDB:Initializing buffer pool, size = 128.0M

2014-06-27 16:02:48 2157 [Note] InnoDB:Completed initialization of buffer pool

2014-06-27 16:02:48 2157 [Note] InnoDB:Highest supported file format is Barracuda.

2014-06-27 16:02:48 2157 [Note] InnoDB: 128rollback segment(s) are active.

2014-06-27 16:02:48 2157 [Note] InnoDB:Waiting for purge to start

2014-06-27 16:02:48 2157 [Note] InnoDB:5.6.19 started; log sequence number 1625977

2014-06-27 16:02:48 2157 [Note] Binlog end

2014-06-27 16:02:48 2157 [Note] InnoDB: FTSoptimize thread exiting.

2014-06-27 16:02:48 2157 [Note] InnoDB: Startingshutdown...

2014-06-27 16:02:50 2157 [Note] InnoDB:Shutdown completed; log sequence number 1625987

OK

 

To start mysqld at boot time you have tocopy

support-files/mysql.server to the rightplace for your system

 

PLEASE REMEMBER TO SET A PASSWORD FOR THEMySQL root USER !

To do so, start the server, then issue thefollowing commands:

 

 /data/mysql/bin/mysqladmin -u root password 'new-password'

 /data/mysql/bin/mysqladmin -u root -h mymaster1.localdomain password'new-password'

 

Alternatively you can run:

 

 /data/mysql/bin/mysql_secure_installation

 

which will also give you the option ofremoving the test

databases and anonymous user created bydefault.  This is

strongly recommended for productionservers.

 

See the manual for more instructions.

 

You can start the MySQL daemon with:

 

  cd. ; /data/mysql/bin/mysqld_safe &

 

You can test the MySQL daemon withmysql-test-run.pl

 

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

 

Please report any problems athttp://bugs.mysql.com/

 

The latest information about MySQL isavailable on the web at

 

 http://www.mysql.com

 

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

 

New default config file was created as/data/mysql/my.cnf and

will be used by default by the server whenyou start it.

You may edit this file to change serversettings

 

7.        修改相关目录权限,提高安全性:

[root@mymaster1 mysql]# chown -R root .

[root@mymaster1 mysql]# chown -R mysql data

 

8.        配置MySQL服务为主机服务,即能用service mysql start启动服务

[root@mymaster1 mysql]# cpsupport-files/mysql.server /etc/init.d/mysql

[root@mymaster1 mysql]# vi /etc/init.d/mysql

把下面的

basedir=

datadir=

修改为

basedir=/data/mysql

datadir=/data/mysql/data

 

9.        启动数据库

[root@mymaster1 mysql]# service mysql start

Starting MySQL[确定]

 

10.    修改数据库root密码

[root@mymaster1 mysql]#/data/mysql/bin/mysqladmin -u root password 'wengjixi'

[root@mymaster1 mysql]#/data/mysql/bin/mysqladmin -u root -h mymaster1.localdomain password 'wengjixi'

 

11.    修改环境变量,把mysql执行文件路径添加到环境变量中

[root@mymaster1 mysql]# vi /etc/profile

PATH=$PATH:/data/mysql/bin

export PATH


[root@mymaster1 mysql]# source /etc/profile

 

12.    测试登录

[root@mymaster1 mysql]# mysql -u root -p

Enter password:

Welcome to the MySQL monitor.  Commands end with ; or /g.

Your MySQL connection id is 5

Server version: 5.6.19 MySQL CommunityServer (GPL)

 

Copyright (c) 2000, 2014, Oracle and/or itsaffiliates. All rights reserved.

 

Oracle is a registered trademark of OracleCorporation and/or its

affiliates. Other names may be trademarksof their respective

owners.

 

Type 'help;' or '/h' for help. Type '/c' toclear the current input statement.

 

mysql>

 

mysql> show variables like '%data%';

+-------------------------------+------------------------+

| Variable_name                 | Value                  |

+-------------------------------+------------------------+

| character_set_database        | latin1                 |

| collation_database            | latin1_swedish_ci      |

| datadir                       | /data/mysql/data/ 

 

 

 

 

 

 

 

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
DockerでのMySQLメモリの使用を減らしますDockerでのMySQLメモリの使用を減らしますMar 04, 2025 pm 03:52 PM

この記事では、DockerのMySQLメモリ使用量を最適化することを調査します。 監視手法(Docker統計、パフォーマンススキーマ、外部ツール)および構成戦略について説明します。 これらには、Dockerメモリの制限、スワッピング、およびcgroupsが含まれます

mysqlの問題を解決する方法共有ライブラリを開くことができませんmysqlの問題を解決する方法共有ライブラリを開くことができませんMar 04, 2025 pm 04:01 PM

この記事では、MySQLの「共有ライブラリを開くことができない」エラーについて説明します。 この問題は、必要な共有ライブラリ(.so/.dllファイル)を見つけることができないMySQLの障害に起因しています。ソリューションには、システムのパッケージMを介してライブラリのインストールを確認することが含まれます。

Alter Tableステートメントを使用してMySQLのテーブルをどのように変更しますか?Alter Tableステートメントを使用してMySQLのテーブルをどのように変更しますか?Mar 19, 2025 pm 03:51 PM

この記事では、MySQLのAlter Tableステートメントを使用して、列の追加/ドロップ、テーブル/列の名前の変更、列データ型の変更など、テーブルを変更することについて説明します。

Linuxでmysqlを実行します(phpmyAdminを使用してポッドマンコンテナを使用して/なし)Linuxでmysqlを実行します(phpmyAdminを使用してポッドマンコンテナを使用して/なし)Mar 04, 2025 pm 03:54 PM

この記事では、PHPMyAdminの有無にかかわらず、LinuxにMySQLを直接インストールするのとPodmanコンテナを使用します。 それは、各方法のインストール手順を詳述し、孤立、携帯性、再現性におけるポッドマンの利点を強調しますが、

sqliteとは何ですか?包括的な概要sqliteとは何ですか?包括的な概要Mar 04, 2025 pm 03:55 PM

この記事では、自己完結型のサーバーレスリレーショナルデータベースであるSQLiteの包括的な概要を説明します。 SQLiteの利点(シンプルさ、移植性、使いやすさ)と短所(同時性の制限、スケーラビリティの課題)を詳しく説明しています。 c

MACOSで複数のMySQLバージョンを実行する:ステップバイステップガイドMACOSで複数のMySQLバージョンを実行する:ステップバイステップガイドMar 04, 2025 pm 03:49 PM

このガイドは、HomeBrewを使用してMacOSに複数のMySQLバージョンをインストールおよび管理することを示しています。 Homebrewを使用して設置を分離し、紛争を防ぐことを強調しています。 この記事では、インストール、開始/停止サービス、および最高のPRAを詳述しています

MySQL接続用のSSL/TLS暗号化を構成するにはどうすればよいですか?MySQL接続用のSSL/TLS暗号化を構成するにはどうすればよいですか?Mar 18, 2025 pm 12:01 PM

記事では、証明書の生成と検証を含むMySQL用のSSL/TLS暗号化の構成について説明します。主な問題は、セルフ署名証明書のセキュリティへの影響を使用することです。[文字カウント:159]

人気のあるMySQL GUIツール(MySQL Workbench、PhpMyAdminなど)は何ですか?人気のあるMySQL GUIツール(MySQL Workbench、PhpMyAdminなど)は何ですか?Mar 21, 2025 pm 06:28 PM

記事では、MySQLワークベンチやPHPMyAdminなどの人気のあるMySQL GUIツールについて説明し、初心者と上級ユーザーの機能と適合性を比較します。[159文字]

See all articles

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser は、オンライン試験を安全に受験するための安全なブラウザ環境です。このソフトウェアは、あらゆるコンピュータを安全なワークステーションに変えます。あらゆるユーティリティへのアクセスを制御し、学生が無許可のリソースを使用するのを防ぎます。

DVWA

DVWA

Damn Vulnerable Web App (DVWA) は、非常に脆弱な PHP/MySQL Web アプリケーションです。その主な目的は、セキュリティ専門家が法的環境でスキルとツールをテストするのに役立ち、Web 開発者が Web アプリケーションを保護するプロセスをより深く理解できるようにし、教師/生徒が教室環境で Web アプリケーションを教え/学習できるようにすることです。安全。 DVWA の目標は、シンプルでわかりやすいインターフェイスを通じて、さまざまな難易度で最も一般的な Web 脆弱性のいくつかを実践することです。このソフトウェアは、

SublimeText3 英語版

SublimeText3 英語版

推奨: Win バージョン、コードプロンプトをサポート!

EditPlus 中国語クラック版

EditPlus 中国語クラック版

サイズが小さく、構文の強調表示、コード プロンプト機能はサポートされていません

SublimeText3 Linux 新バージョン

SublimeText3 Linux 新バージョン

SublimeText3 Linux 最新バージョン