Mysql does not connect to server

Asked

Viewed 993 times

0

Hello, I went to enter the phpmyadmin and appeared this, where should be the problem ??

Code

$coneccao = mysqli_connect("localhost", "root", "MINHASENHA");
mysqli_select_db($coneccao, "luppbox");

the server is hosted in a VPS, instead of localhost I should put the ip of my server ??

  • That I choose at the time to get the information

  • This is a config error in your phpmyadmin.

  • And how do I set it right ??

  • You have posted a mysql connection code, if the connection is not working, it may be that the problem is in mysql, so phpmyadmin may be giving error as well.

  • I am riding a step by step here. It is quiet :)

  • Blz, vlw for help, I’m waiting

Show 1 more comment

1 answer

1


  1. Open phpmyadmin and Store as root.
  2. Create a database called phpmyadmin
  3. Create a user named pma and set the "host" for your web server’s hostname or IP (if your web server and Mysql are on the same machine use localhost), write down the password and guarantee the new user full access to the database phpmyadmin. It is recommended that this user has no access to anything other than this database.
  4. Go to the phpmyadmin installation directory, where you should find a sub-directory called examples.
  5. In examples you will find a file called create_tables.sql. Open in the text editor.
  6. In phpMyAdmin, select the database phpmyadmin and click on the "SQL".
  7. Copy and paste all text from create_tables.sql to the text box and run the query
  8. Open the file config.inc.php in the phpMyAdmin installation directory and add the following lines (or change the existing settings if they are already there):

    $cfg['Servers'][1]['pmadb'] = 'phpmyadmin';
    $cfg['Servers'][1]['controluser'] = 'pma';
    $cfg['Servers'][1]['controlpass'] = '<your password>';
    
    $cfg['Servers'][1]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][1]['relation'] = 'pma_relation';
    $cfg['Servers'][1]['userconfig'] = 'pma_userconfig';
    $cfg['Servers'][1]['table_info'] = 'pma_table_info';
    $cfg['Servers'][1]['column_info'] = 'pma_column_info';
    $cfg['Servers'][1]['history'] = 'pma_history';
    $cfg['Servers'][1]['recent'] = 'pma_recent';
    $cfg['Servers'][1]['table_uiprefs'] = 'pma_table_uiprefs';
    $cfg['Servers'][1]['tracking'] = 'pma_tracking';
    $cfg['Servers'][1]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][1]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][1]['designer_coords'] = 'pma_designer_coords';
    
  9. Save and close the file.

  10. Loader of phpMyAdmin
  11. Log again

Problem solved.

  • Each I did not find create_tables.sql, searched for the entire VPS

  • Found the phpMyAdmin folder?

  • Take a look at the phpMyAdmin folder, if you don’t happen to find it there, the file is on github by the link https://github.com/i-MSCP/phpmyadmin/blob/examples/create_tables.sql

  • It only has a conf. d and this empty

  • Bro, I did everything right, the mistakes are gone, but still can not send information to the database

Browser other questions tagged

You are not signed in. Login or sign up in order to post.