Apache mysql php configuration and mysqlDefault storage engine (InnoDB) is not available solution

Source: Internet
Author: User
Tags install php mysql in mysql tutorial php file php and php tutorial phpinfo

Install and configure apache2
1. Download the latest source code package from the official apache website (www.apache.org).
2. Decompress tar-zxvf apache_1_version).tar.gz to obtain a directory.
3. Go to the directory and execute./configure prefix = [path] enable-module = so to start the configuration.
For example, to install apache under/www/, you can./configure prefix =/wwwenable-moudle = so
4. Execute make after configuration, and then make install. apache installation is complete.
If you want to change the directory, you can use the mv Source File (directory) name to change the name of the new file (directory), and modify the configuration file/conf/httpd under the apahce directory accordingly. conf to change the corresponding path.
Configure mysql tutorial
Because mysql on the official website (www.mysql.com) is a binary package that has been compiled, and you do not need to compile it yourself. Download it to a suitable location, for example, download it to/www.
1. Add a user group and User group for mysqld
Shell> groupadd mysql
Shell> useradd-g mysql
2. Decompress the package with tar-zvxf mysql-version-os.tar.gz and rename mysq with mv to get this directory/www/mysql
3. follow the user manual (/www/mysql/docs/man/manual.html) to enter/www/mysql/bin and edit mysqlaccess, find $ mysql = "/usr/local/bin/mysql" and change the path to "/www/mysql/bin/mysql"
4. Run/www/mysql/scripts/mysql_install_db (provided that you have not installed mysql before)
5. Perform corresponding user authorization:
Shell> chown-r root/usr/local/mysql
Shell> chown-r mysql/usr/local/mysql/data
Shell> chgrp-r mysql/usr/local/mysql
6. Edit/www/mysql/support-files/mysql. server, find basedir =, change it to basedir =/www/mysql, find datadir = ..., Change to datadir =/www/mysql/data
7. Run bin/mysqld_safe user = mysql &
8. Edit/www/mysql/support-files/my-medium.cnf in the [mysqld] bar with basedir =/www/mysql, save the cp my-medium.cnf/etc/my. cnf
9. Go to/www/mysql/support-files and execute mysql. server stop/start to see if any response is returned.
Install php Tutorial 4
1. Download the latest source code package to the official website (php-4.3.3.tar.gz currently)
2. Decompress the package with tar (I will not talk about it again)
3. configure php4 to execute./configure prefix =/www/php4 with-mysql =/[path to mysql]
With-apxs2 =/[path to apxs] where two paths should be changed to with-mysql =/www/mysql
With-apxs2 =/www/apapche/bin/apxs, after successful configuration, execute make, then make install, php installation is complete
4. Edit/www/apache/conf/httpd. conf to add
Addtype application/x-httpd-php. php. phtml
Addtype application/x-httpd-php-source. phps tutorial
These two rows.
5. Run/www/apache/bin/apachectl start
If no problem occurs during startup, you can test the installation of apache, php, and mysql by creating a file named phpinfo. php file, which contains the following code, saves the file, places it in the apache document root directory (htdocs), and then starts your web browser, in the browser address bar, type http: // localhost/phpinfo. php, the browser will display the various variables and variable values of the php and apache systems in a large space. If you can see the details of apache and mysql. php, it indicates that the three have successfully installed and configured.
6. because php is installed under apache in the form of a dynamic module, if you want to reset php, you only need to execute a new configuration option. /configure command, and then execute make and make install. In this way, a new module will appear in the apache module directory. You only need to restart apache to load the new module.

When mysql cannot be started, the following error occurs: default storage engine (innodb) is not available


Add skip-innodb to my. ini (/etc/my. cnf in linux.
After I set it like this, there is no problem in linux. I started mysql in winxp on my local machine today, prompting that the mysql cannot be started. Check the error log of the mysql Directory:
Reference
090613 10:15:27 [error] default storage engine (innodb) is not available
090613 10:15:27 [error] aborting

090613 10:15:27 [note] c: wwwmysqlbinmysqld-nt: shutdown complete

It is estimated that after the parameter is added last time, it never starts up... Mysql of the local machine has not been used for a long time.
Check, my. in ini, the default-storage-engine = innodb engine is set to innodb, and skip-innodb is added to it.

Change default-storage-engine to myisam, and mysql starts OK!
You can delete the ibdata1, ib_logfile0, and ib_logfile1 files in the data directory under skip-innodb.

After the test, when skip-innodb is not added, the three files are deleted and the three files are automatically created at startup. The log is as follows:
Reference
Innodb: the first specified data file. ibdata1 did not exist:
Innodb: a new database to be created!
090613 10:19:37 innodb: setting file. ibdata1 size to 10 mb
Innodb: database physically writes the file full: wait...
090613 10:19:37 innodb: log file. ib_logfile0 did not exist: new to be created
Innodb: setting log file. ib_logfile0 size to 24 mb
Innodb: database physically writes the file full: wait...
090613 10:19:38 innodb: log file. ib_logfile1 did not exist: new to be created
Innodb: setting log file. ib_logfile1 size to 24 mb
Innodb: database physically writes the file full: wait...
Innodb: doublewrite buffer not found: creating new
Innodb: doublewrite buffer created
Innodb: creating foreign key constraint system tables
Innodb: foreign key constraint system tables created
090613 10:19:39 innodb: started; log sequence number 0 0
090613 10:19:39 [note] c: wwwmysqlbinmysqld-nt: ready for connections.


Delete these three files, add skip-innodb, and then start the log:
Reference

090613 10:30:12 [note] c: wwwmysqlbinmysqld-nt: normal shutdown

090613 10:30:12 [note] c: wwwmysqlbinmysqld-nt: shutdown complete

090613 10:30:17 [note] c: wwwmysqlbinmysqld-nt: ready for connections.
Version: '5. 0.45 'socket: ''' port: 3306 source distribution

The three files will not be generated automatically.

Related Article

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.