4

Hi i am intend to connect phpMyAdmin, i have install XAMPP but i change the port using this guide

Cannot start XAMPP on Ubuntu 11.10

I use this URL to enter phpMyAdmin http://localhost:2145/phpmyadmin but get the following error

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

my confic.inc.php is:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['host'] = 'localhost:2145';
$cfg['Servers'][$i]['connect_type'] = 'cookie';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';

thanks for the help

edit

this change resolve the mistake for me

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

Is necessary also stop the mysql and start the Xampp

sudo service mysql stop
/opt/lampp/lampp start
oriaj
  • 141

3 Answers3

1
  1. Goto myini file
  2. Edit the port number to -> port = 4306
  3. Save the file
  4. Restart mySql and apache

Reason being, port 3306 might be used in your local machine. Hence, it can't be connected

1

I have wasted now 2 days on this. Finaly I got the solution, remove xampp and install mysql, phpmyadmin, php5, apache2 manually.

sudo apt-get install apache2 mysql-server mysql-client php5 libapache2-mod-php5
apt-cache search php5

Then pick the ones you need and install them like this:

apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
sudo apt-get install phpmyadmin
sudo service apache2 restart

Now you can open http://127.0.0.1/phpmyadmin/

These upper commands will make your xampp server. It will resolve your problem quickly and worked very smoothly.

Thanks to related articles:
1. Ubuntu 14.10 LAMP server tutorial with Apache 2, PHP 5 and MySQL (MariaDB)
2. How do I change the root directory of an apache server?

alok
  • 121
-1
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

this is right ans

Artur Meinild
  • 31,035