Error connecting mysql database 8

Error connecting mysql database 8

In this tutorial, we will see how to connect to a MySQL database that prohibits access when you have PHP 7 with MySQL 8.





First, you must follow the manual Creating a new MySQL User.


1- Once the creation of the new user has been done, you must go to the path to edit the MySQL configuration file.

Windows: C:\ProgramData\MySQL\MySQL Server[VERSION_HERE]\ my.ini,
OBS: The ProgramData folder is a hidden folder, in order to see it you must access the option Folder > Show hidden files and folders.



Linux: /etc/mysql/my.cnf


2- Then edit the file and where it says 

default-authentication-plugin = caching_sha2_password.Change to

default-autenticaĆ§Ć£o-plugin = mysql_native_password


If you don't find the line above, add this snippet:

[mysqld]
 default_authentication_plugin= mysql_native_password


 
 Finally, restart the MySQL service in order to enable the new settings.


    • Related Articles

    • How to connect to MySQL 8.0

      The MySQL 8 uses a different authentication from your predecessors, that until the moment it's not accepted by PHP 7, that generates the error "The server requested authentication method unknown to the client" at connecting to Scriptcase. First, you ...
    • Correcting access error for the Scriptcase database

      Sometimes we encounter an error accessing the Scriptcase database itself, as shown in the image below:   This problem happens when we change the folder name of the scriptcase to another name, such as "sc". Then, the error happens because the complete ...
    • Connection error: error_profile_test_module

      When we deploy a project and we find this type of error: "Connection error: error_profile_test_module" This error normally occurs when you use a different production environment DBMS Type than the development environment. To solve this, access your ...
    • Change Database Context – MSSQL

      If you use the connection “MSSQL Server” and it shows you an error called “Changed database context to 'database name' ” it's because of the MSSQL Server driver which is available from PHP, because it isn't updated frequently. So, when in this driver ...
    • Using the Database Builder

      The DataBase Builder is a Scriptcase 'DBMS' (Database Manager System), this tool allows you to create tables, modify the structure of your tables, generate ER diagrams (Entity x Relationships), perform the export of the tables among other things. ...
    • Popular Articles

    • Examples for diagrams

      This tutorial shows how you can import and use the new examples for diagrams released with Scriptpcase V9.2.16.  The applications were created using the components: Jsmind, JKanban e Orgchart.  - Sample 1: Mind Map diagram Click here to  execute the ...
    • Oracle Connection - Scriptcase 9 - Linux 64 Bits

      This procedure will only work if you have a Scriptcase manual installation in your server. Installing PHP 7.0 Installing the Scriptcase Manually To connect with Oracle in a Linux System, we must follow these steps below: Step 1 -  Installing these ...
    • Using friendly URL

      The friendly URL was included from Scriptcase 7, in order to make the URL, of the applications generated by Scriptcase, cleaner and easier to associate them with applications. For example, using friendly URLs the link to a Scriptcase application ...
    • Correcting access error for the Scriptcase database

      Sometimes we encounter an error accessing the Scriptcase database itself, as shown in the image below:   This problem happens when we change the folder name of the scriptcase to another name, such as "sc". Then, the error happens because the complete ...
    • Necessary libraries to install the Scriptcase in Windows 7

      To install Windows 7 SP1, you need to verify that the system has the following items installed: * Visual C ++ Redistributable Packages for Visual Studio (2008) x86 and x64. * Visual C ++ Redistributable Packages for Visual Studio (2010) x86 and x64. ...