Software Development, Linux, and Windows

Notes on Software Development, Linux, and Windows

mysql

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 [...]

Tags: , , , ,

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 [...]

Tags: , , , ,

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

Tags: , , , ,

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 [...]

Tags:

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

Tags: , ,

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

Tags:

Posted in MySQL | Comments Off