Showing posts with label Data Base. Show all posts
Showing posts with label Data Base. Show all posts

Wednesday, August 12, 2009

XAMPP MySQL configuration steps Linux

XAMPP MySQL configuration steps
Linux (tried on ubuntu)
1- --> sudo -i
and enter you password (the command sign will be # (root)).

2- --> chmod 777 /opt

3- Install XAMPP on your linux. follow the instruction here.
you can start XAMPP by --> /opt/lampp/lampp start
and stop by --> /opt/lampp/lampp stop

4- now we will edit two configuration files /opt/lampp/etc/my.cnf and /opt/lampp/phpmyadmin/config.inc.php
first:
--> gedit /opt/lampp/etc/my.cnf
replace the attributes in your file as defined below blocks

[client]
password = root
port = 3306
socket = /var/run/mysqld/mysqld.sock

[mysqld]
port = 3306
socket = /var/run/mysqld/mysqld.sock

5- save and close the file.
6- --> gedit /opt/lampp/phpmyadmin/config.inc.php
replace the blocks in your files with the followinng blocks

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
$cfg['Servers'][$i]['AllowNoPasswordRoot'] = false;
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'root';


7- Save and close the file
8- restart XAMPP
--> /opt/lampp/lampp restart

now try MySQL on XAMPP and long live linux :D

Thursday, August 6, 2009

Linux PHP-MySQL Configuration Nightmare

Linux PHP-MySQL Configuration Nightmare

Have you ever tried to configure MySQL to Aptana PHP in linux ?
Here are the easiest steps to follow to accomplish that easily.

1- The one should have installed MySQL libraries --> client, server
and adminstrator from Synaptic Manager in ubuntu
2- Create a php project
3- php file containing: call it "sossa.php"



run in aptana --> u get an error --> can't connect to local mysql
server through socket '/tmp/mysql.sock'
so what to do --> the socket file is existing is /var/run/mysqld/
mysqld.sock --> so vreate a link from the tmp folder to that file
how tooooooo ???!!!
Note: Only the text between quotes will be put in terminal

1- open the terminal as root (adminstrator).
Terminal--> "
sudo -i"
and type ur password.

2- Go to the tmp folder.
Terminal--> "
cd /tmp/"

3- Make the link.
Terminal--> "
ln -s /var/run/mysqld/mysqld.sock mysql.sock"
4- u have to edit my.cnf file to the local host ssetting u did when setting up MySQL

Terminal--> "
gedit /etc/mysql/my.cnf"
a text editor is running --> find the statement "bind-address"
and make its value = "localhost"
The line would be as follows

bind-address = localhost

5- Restart MySQL.

6- Run "sossa.php" && enjoy MySQL in aptana witout the need for XAMPP
now preview the php file in aptana and the error is gone
the output is just:
Nice Work