MySQL config

From Eugene Neighbors
Jump to: navigation, search
{{#if: |Template loop detected: Template:H:h|

{{#if:|Other languages:}} Template:H-langs: {{#if: ||}}}} <- MediaWiki architecture < Database layout

MySQL 4.0.x is not currently required, but is highly recommended. On a larger site, 3.x's inability to do descending sorts on indexes will hurt performance in a number of places. The introduction of the inverse_timestamp field to the cur table and old table was a partial workaround for this. As of MediaWiki 1.5, this field is no longer present. Without it, performance would really suck on 3.x for things like history lists and contribs in particular.

The fulltext search can also use the boolean search mode in MySQL 4.0. Set $wgDBmysql4 = true in LocalSettings.php to activate this mode, which should be faster and more flexible than the manually created parser.

Note that you should avoid versions of MySQL 4 prior to 4.0.13 due to various bugs.

You may wish to adjust the settings on the fulltext search for the stopword list and the smallest indexed word. Check mysql docs for that.


1. initialize the database

mysql_install_db 

2. start sql server by

safe_mysqld

or

mysqld_safe

or

 /etc/init.d/mysql start  # works on Fedora- ,Debian- and Ubuntu-Systems

3. test it by

mysqlshow

4. set up user password:

mysql -u root

The prompt 'mysql>' should appear now Choose the right database with user account table

use mysql;
update user set Password=PASSWORD('mypassword_here');
flush privileges;
exit; 

Note: be aware the ; after the flush command, it is required for standard SQL statement This will set all user's passwords to the same one. It is a quick but dirty solution. For more advanced solution, refer to http://www.doctaur.com/dtdocs/databases/mysql-manual/securing-the-initial-mysql-accounts.html

Note 2: if the above command does not work, try adding the -p flag to it even if you have not set the password yet, e.g.: 'sql -u root -p'. I had to do that when setting up mysql50-server on FreeBSD5.4 and when it asked for the password I just gave it anything and it worked.

Note 2.1: Alternatively, use mysqladmin -u root password pswd-you-want-to-set-to-here -p and hit return for password to set it the first time through.

5. shut down the server

mysqladmin shutdown -u root -p

Input the password to shutdown

6. connect the sql server in console and enable SQL query mode

mysqld_safe -u root -p

Input the password to proceed

Note: You may also start the MySQL server from XAMPP Contrl Panel Applicaiton.

See also ugly MySQL hacks, old Upgrade to MySQL 4.0 page.

Next page: Help:Setting user rights in MediaWiki >

References

mysql post installation tasks/configurations http://www.doctaur.com/dtdocs/databases/mysql-manual/unix-post-installation-procedures.html

Personal tools