MySQL does not connect to server

0

Hello, I went into phpmyadmin and it appeared, where is that supposed to 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 should I put the ip of my server ??

    
asked by anonymous 14.05.2015 / 18:14

1 answer

1
  • Open phpmyadmin and log in as root.
  • Create a database named phpmyadmin
  • Create a user named pma and set the "host" to the hostname or IP of your web server (if your web server and MySQL are on the same machine use localhost ), write down the password and new user full access to database phpmyadmin . It is recommended that this user does not have access to anything other than this database.
  • Go to the phpmyadmin installation directory, where you should find a sub-directory called examples .
  • In examples you will find a file named create_tables.sql . Open in the text editor.
  • In phpMyAdmin, select the phpmyadmin database and click the "SQL" tab.
  • Copy and paste all text from create_tables.sql into the text box and run the query
  • Open the file config.inc.php in the phpMyAdmin installation directory and add the following lines (or change 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';
    
  • Save and close the file.

  • phpMyAdmin login
  • Log in again
  • Problem solved.

        
    14.05.2015 / 18:27