Talk:Server

From ArchWiki
Revision as of 12:54, 17 December 2012 by Fengchao (Talk | contribs) (Configuration: LAMP has more update info.)

Jump to: navigation, search

Original Document

Template:Box Note

LAMP

MySQL

  • Configure MySQL as described at the MySQL wiki.
  • Edit /etc/php/php.ini (this is in /usr/etc on older systems) to uncomment the following line (By removing ;):
;extension=mysql.so
  • You can add minor privileged users for your web scripts by editing the tables found in the mysql database. You have to restart MySQL for changes to take effect. Don't forget to check the mysql/users table. If there's a second entry for root and your hostname is left with no password set, everybody from your host probably could gain full access. Perhaps see next section for these jobs.
  • Run in terminal (as root):
# /etc/rc.d/mysqld start
  • MySQL should now be running. Test by visiting http://localhost/phpMyAdmin in a web browser - for testing by phpMyAdmin, you should have installed phpMyAdmin (pacman -S phpmyadmin). It should display phpMyAdmin main page.
  • Edit /etc/rc.conf (to start MySQL at boot):
DAEMONS=(... mysqld ...)

Or add this line to rc.local:

/etc/rc.d/mysqld start
  • You can get the "error no. 2013: Lost Connection to mysql server during query" message instantly whenever you try to connect to the MySQL daemon by TCP/IP. This is the TCP wrappers system (tcpd), which uses the hosts_access(5) system to allow or disallow connections.
  • If you're running into this problem, be sure to add this to your /etc/hosts.allow file:
 # mysqld : ALL : ALLOW
 # mysqld-max : ALL : ALLOW
 # and similar for the other MySQL daemons.
  • Notes: The examples above are the simplest case, telling tcpd to allow connections from anywhere. You may wish to use a more-appropriate choice of permissible sources instead of ALL. Just make sure that localhost and the IP address (numeric or DNS) of the interface by which you connect are specified.
  • You might also need to edit /etc/my.cnf and comment out the skip-networking line as such:
skip-networking

to

#skip-networking