How to install and set remote connection for Linux MySQL commands

Source: Internet
Author: User
Tags mysql commands zts mysql command line

These things are just a bit confusing for new users. Here is my installation notes. It is successfully installed on the centos virtual machine. For more information about how to install MySQL 5.0 on Linux, how to install PHP 5 on Linux, how to install Apache 2 on Linux

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

CD/home/tmp groupadd MySQL useradd-G MySQL tar-zxvf mysql-5.1.33.tar.gz CD mysql-5.1.33. /configure -- prefix =/usr/local/MySQL make install CD/usr/local/MySQL chown-r root. bin/MySQL-u root-P chgrp-r MySQL. (Note that there is .) CD/home/tmp CD mysql-5.1.33 ln-S/usr/local/MySQL // usr/local/MySQL CP support-files/my-small.cnf/etc/My. CNF modify my. CNF adds user = MySQL under [sqld. chown root/etc/My. CNF Chgrp root/ECT/My. CNF chmod 644/etc/My. CNF/usr/local/MySQL/bin/mysqld_safe -- user = MySQL & CP support-files/MySQL. server/etc/init. d/MySQL chmod 755/etc/init. d/MySQL chkconfig -- add MySQL chkconfig -- level 35 MySQL on/usr/local/MySQL/bin/mysql_install_db -- user = MySQL/usr/local/MySQL/bin/MySQL-u Root (If you can access the MySQL command line, mySQL configuration is successful .) Edit/etc/My. CNF

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

Apache installation, first go to the/home/tmp directory (CD/home/tmp) tar-zxvf httpd-2.2.13.tar.gz CD httpd-2.2.13. /configure -- prefix =/usr/local/apache2 -- enable-so -- enable-Rewrite -- enable-auth-digest = shared -- enable-SSL -- enable-Deflate make history make install CP /usr/local/apache2/bin/apachectl/etc/init. d chmod 755/etc/init. d/apachectl/usr/local/apache2/bin/apachectl start PHP installation CD/home/tmp tar-xzf php-5.3.0.tar.gz CD php-5.3.0. /configure -- prefix =/usr/local/PHP \ -- with-apxs2 =/usr/local/apache2/bin/apxs \ -- With-mysql =/usr/local/MySQL \ -- -PDO-mysql \ -- With-zlib \ -- With-libxml-Dir \ -- With-XSL \ -- enable-mbstring \ -- enable-Zend-multibyte \ -- enable-sockets \-- enable-soap \ -- 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

Cp php. ini-development/usr/local/PHP/lib/PHP. INI/usr/local/apache2/bin/apachectl start/usr/local/apache2/bin/apachectl stop/usr/local/apache2/bin/apachectl start attachment: linux MySQL allows remote connection

/Usr/local/MySQL/bin/MySQL-u root-P (enter MySQL) use MySQL; select 'host', 'user' from user; update user set 'host' = '%' Where 'user' = 'root' limit 1; flush privileges; Be sure to 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 user permissions and bind them to the MySQL server.
1. Open user permissions under the command line: grant all privileges on Drupal. * To user@192.168.1.80 identified by 'user-password';
In the administrator interface, you can add access permissions through user management add host-> Any host (by default, root users can only access the local machine, new users can remotely)
2. Cancel 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
comment "bind-address = 127.0.0.1"
sudo/etc/init. d/MySQL restart Restart for remote access

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.