InnoDB Chinese Reference Manual---3 Establish a InnoDB database

Source: Internet
Author: User
Tags command line manual log mysql mysql client mysql version reference thread
Reference | Reference Manual | data | database | Chinese InnoDB chinese reference Manual---Dog dog (heart sail) Translation 3 establish a InnoDB database
Suppose you have installed MySQL and have modified the MY.CNF contains the necessary InnoDB parameter settings. Before you start MySQL, you must check that the data specified for InnoDB and log file paths exist and that you have sufficient permissions on those directories. InnoDB does not create a directory of its own and can only create files. Also check to see if there is enough disk space to store the data and log files.

When creating a InnoDB database, it is best to run the MySQL service mysqld on a command-line basis, rather than from safe_mysqld or Windows services. You can see the build process when you run the service from the command line.

Now running the MySQL service, InnoDB will build the data files and log files. InnoDB will display the following information:

heikki@donna:~/mysql-3.23.48/sql> mysqld 020204 23:17:12 innodb:the-A-specified data file/dr2/tmp/heikki/data/ Ibdata1 did not exist:innodb:a new database to is created! innodb:setting file/dr2/tmp/heikki/data/ibdata1 size to MB Innodb:database physically writes the file full:wait ... 020204 23:17:16 Innodb:data File/dr2/tmp/heikki/data/ibdata2 did not exist:new to be created innodb:setting Tmp/heikki/data/ibdata2 Size to MB Innodb:database physically writes the file full:wait ... 020204 23:17:41 Innodb:data File/dr2/tmp/heikki/data/ibdata3 did not exist:new to be created innodb:setting Tmp/heikki/data/ibdata3 size to 1000 MB Innodb:database physically writes the file full:wait ... 020204 23:21:37 innodb:log file./ib_logfile0 did not exist:new to is created innodb:setting Log file./ib_logfile0 E to MB Innodb:database physically writes the file full:wait ... 020204 23:21:39 innodb:log file./ib_logfile1 did not exist:new to Be created innodb:setting log file/ib_logfile1 size to MB Innodb:database physically writes the file full:wait. . 020204 23:21:41 innodb:log file./ib_logfile2 did not exist:new to is created innodb:setting Log file./ib_logfile2 E to MB Innodb:database physically writes the file full:wait ... Innodb:doublewrite Buffer not found:creating new Innodb:doublewrite buffer created innodb:creating foreign key Constra int system tables innodb:foreign key constraint system tables created 020204 23:21:45 innodb:started for C Onnections

Now a new InnoDB database has been built. You can connect to MySQL server via MySQL client program (such as MySQL). When the MySQL service is closed via mysqladmin shutdown, the InnoDB output looks like this:

020204 23:34:45 mysqld:normal shutdown 020204 23:34:45 ... 020204 23:34:47 Innodb:shutdown completed 020204 23:34:47 mysqld:shutdown Complete

Now you can see that the data files and log files have been established. A small file with a sentence of ib_arch_log_0000000000 will also be included in the log file directory. This is the file that was formed after the database was established after the InnoDB Log archive (logs archiving) switch was closed. When MySQL starts again, the screen looks like this:

heikki@donna:~/mysql-3.23.48/sql> mysqld 020204 23:34:27 innodb:started mysqld:ready for connections
3.1 Several errors that may occur when you establish a database
If InnoDB displays an operating system error for a file operation, check the meaning of section 13.2 error codes. Common errors are as follows: No InnoDB data or log file directories were created. MYSQLD does not have permission to establish files under those directories. MYSQLD does not have permission to read my.cnf or My.ini files, so the options specified cannot be configured. Disk space is full or exceeds disk quota. A subdirectory with the same name as the data file was established. Error setting syntax in Innodb_data_home_dir or Innodb_data_file_path.
If an error occurs when the InnoDB database is created, you must delete any files created by InnoDB. This means all data files, all log files, log archive files, and if you have established some InnoDB tables, you must delete the corresponding ". frm" file in the MySQL data directory. You can then try to establish a InnoDB database. It is best to start the MySQL service on a command-line basis so that you can see the setup process.
3.2 Shut down MySQL service
You usually have to turn off the database service before you turn off your computer. Enter mysqladmin shutdown at the command line to service.

The MySQL service can be installed as a Windows system service under Windows NT and 2000. This allows the MySQL service to start automatically when the computer starts, or to enter MS-DOS command NET start MySQL on a command-line basis or from the operating system's service menu.

If you run MySQL as a system service, you can turn off the service through the MS-dos NET STOP MySQL command or the operating system's service menu. You can also let the operating system automatically shut down MySQL before exiting. In a system below the MySQL 3.23.47 version, the Windows operating system only waits for a period of time for InnoDB to shut down completely, and if the limit time exceeds the data service thread will be killed. That in the next InnoDB boot had to be done without a crash fix. Starting with the MySQL version 3.23.48, the operating system waits for InnoDB to shut down completely.

If your operating system does not provide enough time for InnoDB to shut down completely, the safest option is to run the MySQL service at the MS-DOS command line and use mysqladmin shutdown to shut down the service.

Under Windows NT (but Windows 2000 has no problems), when the computer shuts down, one of the possible problems is that Windows NT waits 20 seconds by default to shut down a service and the service fails to shut down to kill the service thread. You can modify the HKEY_LOCAL_MACHINE Ystem\currentcontrolset\control by running Registry Editor \WINNT Ystem32\regedt32.exe. WaitToKillServiceTimeout the key value to increase this default value. Given a larger value in milliseconds.


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.