RSS
 

Archive for the ‘mysql’ Category

Forbidden 403 Error after installing phpMyAdmin

12 Mar

After I had installed phpMyAdmin (in my case centos, using YUM) I received a 403 forbidden error. By default phpmyadmin installed path is /usr/share/phpmyadmin and the apache configuration file is located in /etc/httpd/conf.d/phpmyadmin.conf.

To fix:

vi /etc/httpd/conf.d/phpmyadmin.conf

Remove or comment these lines

#Order Allow,Deny
#Deny from all
Allow from 127.0.0.1

Restart the apache server.

/etc/init.d/httpd restart

You should be able to see phpmyadmin working by going to http://ipaddress/phpmyadmin

 
No Comments

Posted in apache, mysql

 

Import a CSV file into MySql

28 Feb

I recently received a CSV file that I needed to import into MySQL, I tried to use Navicat on a Windows machine but the file was large enough to cause it to hang. So I went to the command line on the server and created it as follows

mysqlimport –fields-terminated-by=”,” –fields-optionally-enclosed-by=”\”" –lines-terminated-by=”\n” databasename /pathtocsvfile/csv.csv -u mysqlusername -p

note that the name of the file I was importing was csv.csv, in order for this to work you must have created a table that will accept this data wit the same name as the file you are importing (minus the extension)

 
No Comments

Posted in mysql

 

Guide : MySQL Importing and Exporting

24 Jul

Importing a SQL File from the command line

mysql -u USER -p DBNAME < FILENAME.sql

Exporting a SQL File from the command line

mysql -u USER -p DBNAME > FILENAME.sql

 
No Comments

Posted in guide, mysql