Code: Select all
CREATE USER '[user]'@'[host]' IDENTIFIED WITH caching_sha2_password BY '[password]';
und gewährt diesem Benutzer die einzigen Berechtigungen, die er benötigt:
Code: Select all
grant insert, select on [db].[table] to '[user]'@'[host]';
Ich verwende speziell nicht mySQL_NATIVE_PASSWORD , da es in MySQL 8.4 standardmäßig deaktiviert und in MySQL 9.0 entfernt wird.
Code: Select all
// Recommended, compiles with mysqlnd
$ ./configure --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
// Alternatively recommended, compiles with mysqlnd
$ ./configure --with-mysqli --with-pdo-mysql
// Not recommended, compiles with libmysqlclient
$ ./configure --with-mysqli=/path/to/mysql_config --with-pdo-mysql=/path/to/mysql_config
< /code>
Während MySQL 8.4 - 8.4.1.2 Caching SHA -2 -Pluggable -Authentifizierung lautet teilweise: < /p>
**Installing SHA-2 Pluggable Authentication**
The caching_sha2_password plugin exists in server and client forms:
- The server-side plugin is built into the server, need not be loaded
explicitly, and cannot be disabled by unloading it.
- The client-side plugin is built into the libmysqlclient client
library and is available to any program linked against libmysqlclient.
The server-side plugin uses the sha2_cache_cleaner audit plugin as a helper to perform password cache management.
sha2_cache_cleaner, like caching_sha2_password, is built in and need not be installed.
< /code>
Ich kompile derzeit PHP 8.4 mit: < /p>
./configure \
--prefix=$path_to_php_bin \
--with-apxs=/usr/local/apache2/bin/apxs \
--enable-mbstring \
--with-mysqli \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv=$(brew --prefix libiconv) \
--enable-fpm
Code: Select all
Fatal error: Uncaught mysqli_sql_exception: The server requested authentication method unknown to the client [caching_sha2_password] in [path_to_global_php_commands_include_file]:201
Code: Select all
#0 [path_to_global_php_commands_include_file](201): mysqli_connect([host], [user], [password], [db])
#1 [path_to_mysqli_connect_variables_file](10): connectDBi([host], [user], [password], [db])
#2 [path_to_php/html_header_file](12):include('[path_to_mysqli_connect_variables_file]')
#3 [path_to_website_index_file](3): include('[path_to_php/html_header_file]')
#4 {main} thrown in [path_to_global_php_include_commands_file] on line 201
kompilieren Sie Php 8.* mit libmysqlclient ? />
Code: Select all
$ ./configure --with-mysqli=/path/to/mysql_config --with-pdo-mysql=/path/to/mysql_config
Danke im Voraus!