Mysql Command installation allows remote connection

Source: Internet
Author: User
Tags zts

Linux mysqlapache php installation process. Copy the tar.gz files of apache, mysql, and php to the/home/tmp directory. Run the following command:

Install mysql in Linux

 
 
  1. Cd/home/tmp
  2. Groupadd mysql
  3. Useradd-g mysql
  4. Tar-zxvf mysql-5.1.33.tar.gz
  5. Cd mysql-5.1.33
  6. ./Configure -- prefix =/usr/local/mysql
  7. Make
  8. Make install
  9. Cd/usr/local/mysql
  10. Chown-R root.
  11. Bin/mysql-u root-p
  12. Chgrp-R mysql. (Note that there is one .)
  13. Cd/home/tmp
  14. Cd mysql-5.1.33
  15. Ln-s/usr/local/mysql // usr/local/mysql
  16. Cp support-files/my-small.cnf/etc/my. cnf
  17. Modify my. cnf and add user = mysql under [sqld.
  18. Chown root/etc/my. cnf
  19. Chgrp root/ect/my. cnf
  20. Chmod 644/etc/my. cnf
  21. /Usr/local/mysql/bin/mysqld_safe -- user = mysql &
  22. Cp support-files/mysql. server/etc/init. d/mysql
  23. Chmod 755/etc/init. d/mysql
  24. Chkconfig -- add mysql
  25. Chkconfig -- level 35 mysql on
  26. /Usr/local/mysql/bin/mysql_install_db -- user = mysql
  27. /Usr/local/mysql/bin/mysql-u root (if you can enter the mysql command line, the mysql configuration is successful .)

Edit/etc/my. cnf

[Client] + default-character-set = utf8 [mysqld] + default-character-set = utf8 [mysql] + default-character-set = utf8

 
 
  1. To install apache, go to the/home/tmp directory (cd/home/tmp)
  2. Tar-zxvf httpd-2.2.13.tar.gz
  3. Cd httpd-2.2.13./configure -- prefix =/usr/local/apache2 -- enable-so -- enable-rewrite -- enable-auth-digest = shared -- enable-ssl -- enable-deflate
  4. Make
  5. History
  6. Make install
  7. Cp/usr/local/apache2/bin/apachectl/etc/init. d
  8. Chmod 755/etc/init. d/apachectl
  9. /Usr/local/apache2/bin/apachectl start
  10.  
  11. Php installation
  12. Cd/home/tmp
  13. Tar-xzf php-5.3.0.tar.gz
  14. Cd php-5.3.0
 
 
  1. ./configure --prefix=/usr/local/php \  
  2. --with-apxs2=/usr/local/apache2/bin/apxs \  
  3. --with-mysql=/usr/local/mysql \  
  4. --with-pdo-mysql \  
  5. --with-zlib \  
  6. --with-libxml-dir \  
  7. --with-xsl \  
  8. --enable-mbstring \  
  9. --enable-zend-multibyte \  
  10. --enable-sockets \  
  11. --enable-soap \  
  12. --enable-zip 

Linux mysql

Make install modify apache httpd. conf (apache/conf/httpd. conf) to add the following parts: LoadModule php5_module modules/libphp5.so AddType application/x-httpd-php. php

 
 
  1. cp php.ini-development /usr/local/php/lib/php.ini  
  2. /usr/local/apache2/bin/apachectl start  
  3. /usr/local/apache2/bin/apachectl stop  
  4. /usr/local/apache2/bin/apachectl start 

Attachment: Linux mysql allows remote connection

 
 
  1. /Usr/local/mysql/bin/mysql-u root-p (enter mysql)
  2. Use mysql;
  3. SELECT 'host', 'user' FROM User;
  4. UPDATE user SET 'host' = '%' WHERE 'user' = 'root' LIMIT 1;
  5. Flush privileges;
  6. Note that you must enter ";" in the mysql command line format ";".

V can be made after configure.
Linux mysql
Make install note that the full path of pdo_mysql is:
/Usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
Then in/usr/local/lib/php. ini
Add the following sentence:
Extension =/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
Restart apache and you will see that pdo_mysql has been loaded successfully.

Mysql is installed in ubuntu7.10. By default, only local access is allowed. You need to enable the user permission and bind it to mysql.
1. Open the user permission under the command line: grant all privileges on drupal. * to user@192.168.1.80 identified by 'user-password ';
On the administrator interface, you can add host-> any host through user management to add access permissions (by default, root users can only access the local machine, and new users can remotely)
2. Cancel the mysql local binding:
Edit/etc/mysql/my. cnf
# Instead of skip-networking the default is now to listen only on
# Localhost which is more compatible and is not less secure.
Bind-address = 127.0.0.1
Annotate "bind-address = 127.0.0.1"
Sudo/etc/init. d/mysql restart Remote Access

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.