1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<code>[root@server ~]</code><code># /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/</code>
<code>Installing MySQL system tables...2013-05-19 10:42:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation </code><code>for</code> <code>more</code> <code>details).</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: The InnoDB memory heap is disabled</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Compressed tables use zlib 1.2.3</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Not using CPU crc32 instructions</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Initializing buffer pool, size = 128.0M</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Completed initialization of buffer pool</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Highest supported </code><code>file</code> <code>format</code> <code>is Barracuda.</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: 128 rollback segment(s) are active.</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Waiting </code><code>for</code> <code>purge to start</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: 5.6.11 started; log sequence number 1600607</code>
<code>ERROR: 1005 Can</code><code>'t create table '</code><code>db' (errno: 13)</code>
<code>2013-05-19 10:42:24 2007 [ERROR] Aborting</code>
<code>2013-05-19 10:42:24 2007 [Note] Binlog end</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: FTS optimize thread exiting.</code>
<code>2013-05-19 10:42:24 2007 [Note] InnoDB: Starting </code><code>shutdown</code><code>...</code>
<code>2013-05-19 10:42:25 2007 [Note] InnoDB: Shutdown completed; log sequence number 1600617</code>
<code>2013-05-19 10:42:25 2007 [Note] </code><code>/usr/local/mysql//bin/mysqld</code><code>: Shutdown complete</code>
解決方法:
将系統/etc/下預設的my.cnf 替換成mysql資料包中的配置檔案
<code>[root@server ~]</code><code># cp /usr/local/mysql/support-files/my-default.cnf /etc/my.cnf</code>
再次執行:
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<code>[root@server ~]</code><code># /usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql/ --datadir=/data/ --user=mysql</code>
<code>Installing MySQL system tables...2013-05-19 10:52:57 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation </code><code>for</code> <code>more</code> <code>details).</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: The InnoDB memory heap is disabled</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Compressed tables use zlib 1.2.3</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Not using CPU crc32 instructions</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Initializing buffer pool, size = 128.0M</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Completed initialization of buffer pool</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: The first specified data </code><code>file</code> <code>.</code><code>/ibdata1</code> <code>did not exist: a new database to be created!</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Setting </code><code>file</code> <code>.</code><code>/ibdata1</code> <code>size to 12 MB</code>
<code>2013-05-19 10:52:57 2180 [Note] InnoDB: Database physically writes the </code><code>file</code> <code>full: wait...</code>
<code>2013-05-19 10:52:58 2180 [Note] InnoDB: Setting log </code><code>file</code> <code>.</code><code>/ib_logfile101</code> <code>size to 48 MB</code>
<code>2013-05-19 10:52:59 2180 [Note] InnoDB: Setting log </code><code>file</code> <code>.</code><code>/ib_logfile1</code> <code>size to 48 MB</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Renaming log </code><code>file</code> <code>.</code><code>/ib_logfile101</code> <code>to .</code><code>/ib_logfile0</code>
<code>2013-05-19 10:53:00 2180 [Warning] InnoDB: New log files created, LSN=45781</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Doublewrite buffer not found: creating new</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Doublewrite buffer created</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: 128 rollback segment(s) are active.</code>
<code>2013-05-19 10:53:00 2180 [Warning] InnoDB: Creating foreign key constraint system tables.</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Foreign key constraint system tables created</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Creating tablespace and datafile system tables.</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Tablespace and datafile system tables created.</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: Waiting </code><code>for</code> <code>purge to start</code>
<code>2013-05-19 10:53:00 2180 [Note] InnoDB: 5.6.11 started; log sequence number 0</code>
<code>2013-05-19 10:53:05 2180 [Note] Binlog end</code>
<code>2013-05-19 10:53:05 2180 [Note] InnoDB: FTS optimize thread exiting.</code>
<code>2013-05-19 10:53:05 2180 [Note] InnoDB: Starting </code><code>shutdown</code><code>...</code>
<code>2013-05-19 10:53:07 2180 [Note] InnoDB: Shutdown completed; log sequence number 1625977</code>
<code>OK</code>
<code>Filling help tables...2013-05-19 10:53:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation </code><code>for</code> <code>more</code> <code>details).</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: The InnoDB memory heap is disabled</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Compressed tables use zlib 1.2.3</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Not using CPU crc32 instructions</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Initializing buffer pool, size = 128.0M</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Completed initialization of buffer pool</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Highest supported </code><code>file</code> <code>format</code> <code>is Barracuda.</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: 128 rollback segment(s) are active.</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Waiting </code><code>for</code> <code>purge to start</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: 5.6.11 started; log sequence number 1625977</code>
<code>2013-05-19 10:53:07 2203 [Note] Binlog end</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: FTS optimize thread exiting.</code>
<code>2013-05-19 10:53:07 2203 [Note] InnoDB: Starting </code><code>shutdown</code><code>...</code>
<code>2013-05-19 10:53:09 2203 [Note] InnoDB: Shutdown completed; log sequence number 1625987</code>
<code>To start mysqld at boot </code><code>time</code> <code>you have to copy</code>
<code>support-files</code><code>/mysql</code><code>.server to the right place </code><code>for</code> <code>your system</code>
<code>PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !</code>
<code>To </code><code>do</code> <code>so, start the server, </code><code>then</code> <code>issue the following commands:</code>
<code> </code><code>/usr/local/mysql//bin/mysqladmin</code> <code>-u root password </code><code>'new-password'</code>
<code> </code><code>/usr/local/mysql//bin/mysqladmin</code> <code>-u root -h server.clovem.com password </code><code>'new-password'</code>
<code>Alternatively you can run:</code>
<code> </code><code>/usr/local/mysql//bin/mysql_secure_installation</code>
<code>which</code> <code>will also give you the option of removing the </code><code>test</code>
<code>databases and anonymous user created by default. This is</code>
<code>strongly recommended </code><code>for</code> <code>production servers.</code>
<code>See the manual </code><code>for</code> <code>more</code> <code>instructions.</code>
<code>You can start the MySQL daemon with:</code>
<code> </code><code>cd</code> <code>. ; </code><code>/usr/local/mysql//bin/mysqld_safe</code> <code>&</code>
<code>You can </code><code>test</code> <code>the MySQL daemon with mysql-</code><code>test</code><code>-run.pl</code>
<code> </code><code>cd</code> <code>mysql-</code><code>test</code> <code>; perl mysql-</code><code>test</code><code>-run.pl</code>
<code>Please report any problems with the .</code><code>/bin/mysqlbug</code> <code>script!</code>
<code>The latest information about MySQL is available on the web at</code>
<code> </code><code>http:</code><code>//www</code><code>.mysql.com</code>
<code>Support MySQL by buying support</code><code>/licenses</code> <code>at http:</code><code>//shop</code><code>.mysql.com</code>
<code>WARNING: Found existing config </code><code>file</code> <code>/usr/local/mysql//my</code><code>.cnf on the system.</code>
<code>Because this </code><code>file</code> <code>might be </code><code>in</code> <code>use, it was not replaced,</code>
<code>but was used </code><code>in</code> <code>bootstrap (unless you used --defaults-</code><code>file</code><code>)</code>
<code>and when you later start the server.</code>
<code>The new default config </code><code>file</code> <code>was created as </code><code>/usr/local/mysql//my-new</code><code>.cnf,</code>
<code>please compare it with your </code><code>file</code> <code>and take the changes you need.</code>
<code>WARNING: Default config </code><code>file</code> <code>/etc/my</code><code>.cnf exists on the system</code>
<code>This </code><code>file</code> <code>will be </code><code>read</code> <code>by default by the MySQL server</code>
<code>If you </code><code>do</code> <code>not want to use this, either remove it, or use the</code>
<code>--defaults-</code><code>file</code> <code>argument to mysqld_safe when starting the server</code>
檢視資料目錄中的檔案:
<code>[root@server ~]</code><code># ls /data/ -l</code>
<code>total 110604</code>
<code>-rw-rw----. 1 mysql mysql 12582912 May 19 10:53 ibdata1</code>
<code>-rw-rw----. 1 mysql mysql 50331648 May 19 10:53 ib_logfile0</code>
<code>-rw-rw----. 1 mysql mysql 50331648 May 19 10:52 ib_logfile1</code>
<code>drwx------. 2 mysql mysql 4096 May 19 10:53 mysql</code>
<code>drwx------. 2 mysql mysql 4096 May 19 10:53 performance_schema</code>
<code>drwx------. 2 mysql mysql 4096 May 19 10:52 </code><code>test</code>
<code></code>
本文轉自 暗黑魔君 51CTO部落格,原文連結:http://blog.51cto.com/clovemfong/1203910,如需轉載請自行聯系原作者