Software Development, Linux, and Windows

Notes on Software Development, Linux, and Windows


Posts about MySQL


Open mysql on firewall in CentOS 7

Login or set user to root su – See the before of what services are open on the public zone firewall-cmd –zone=public –list-services Open up access to mysql on the public zone firewall-cmd –zone=public –add-service=mysql See the after of what services are open on the public zone firewall-cmd –zone=public –list-services Once verified, modify the permanent [...]

Posted in CentOS, Linux, MySQL | Comments Off

Configure WordPress on CentOS to connect to a remote database

Sounds simple enough to do, but I ran into a problem along the way. I also go over the solution here. Login or switch user to root: su – Change directory to your wordpress installation: For me this is in /var/www/html/wordpress. cd /var/www/html/wordpress Edit the WordPress config file: vi wp-config.php Change the “MySQL hostname” setting: [...]

Posted in CentOS, Linux, MySQL, WordPress | Comments Off

Allow Apache/PHP on CentOS to connect to a remote database

The issue for me was that by defualt SELinux was preventing this access from happening. Perform the following steps on the machine running Apache. Login or swith user to root: su – Enter the following command: setsebool -P httpd_can_network_connect_db=1 NOTE: When I ran this command on my system which is a 2.8 GHz Pentium 4 [...]

Posted in Apache, CentOS, Linux, MySQL, PHP | Comments Off

Install WordPress on CentOS

Follow these steps to install WordPress on CentOS. Prerequisites: Install MySQL on CentOS 6.2 Install Apache and PHP on CentOS 6.2 Install WordPress: su – wget http://wordpress.org/latest.tar.gz tar -xvzf latest.tar.gz -C /var/www/html Create MySQL Database for WordPress: mysql -u root -p #create new user create user wordpress@localhost identified by “password”; #create new database create database [...]

Posted in Apache, CentOS, Linux, MySQL, WordPress | Comments Off

Install Apache and PHP on CentOS

Follow these steps to install Apache and PHP on CentOS. Install Apache and PHP components with PHP support for MySQL: yum install httpd php php-common php-mysql Start Apache: service httpd start Configure Apache to start at system startup: chkconfig httpd on

Posted in Apache, CentOS, Linux, MySQL, PHP | Comments Off

Creating users and granting permissions in MySQL

A common scenario might be to just create a user and allow that user to access a database from anywhere including the localhost where MySQL is installed. Doing this actually requires the creation of two user accounts and granting permission to each of them separately. One account is specifically for the localhost where MySQL is [...]

Posted in MySQL | Comments Off

Install MySQL on CentOS

su – yum install mysql-server mysql mysql-devel service mysqld start chkconfig mysqld on /usr/bin/mysql_secure_installation

Posted in CentOS, Linux, MySQL | Comments Off

Dump and Restore a MySQL database

Dump a MySQL database to a file: mysqldump -h ‘hostname’ -u db_username -p –quick db_name | gzip > dump_file_name.gz Restore a MySQL database from a dump file: gunzip < dump_file_name.gz | mysql -h ‘hostname’ -u db_username -p db_name

Posted in MySQL | Comments Off