Ben PHP ve CakePHP için yeni kullanarak 'localhost'. CakePhp kullanarak veritabanımı kablolarken sorunları bulmak.sqlstate [HY000] [1045] Erişim kullanıcı 'kullanıcı adı' için reddedildi @ CakePHP'yi
Aşağıda benim app yapılandırmasıdır. Ben 5.4.40-0 My app.php dosyasında bir web MVC uygulama datasources için
Girişi oluşturmak CakePHP'ye 3.0.4 kullanıyorum
/**
* Connection information used by the ORM to connect
* to your application's datastores.
* Drivers include Mysql Postgres Sqlite Sqlserver
* See vendor\cakephp\cakephp\src\Database\Driver for complete list
*/
'Datasources' => [
'default' => [
'className' => 'Cake\Database\Connection',
'driver' => 'Cake\Database\Driver\Mysql',
'persistent' => false,
'host' => 'localhost',
/**
* CakePHP will use the default DB port based on the driver selected
* MySQL on MAMP uses port 8889, MAMP users will want to uncomment
* the following line and set the port accordingly
*/
//'port' => 'nonstandard_port_number',
'username' => 'test2',
'password' => 'computer',
'database' => 'jobs',
'encoding' => 'utf8',
'timezone' => 'UTC',
'cacheMetadata' => true,
/**
* Set identifier quoting to true if you are using reserved words or
* special characters in your table or column names. Enabling this
* setting will result in queries built using the Query Builder having
* identifiers quoted when creating SQL. It should be noted that this
* decreases performance because each query needs to be traversed and
* manipulated before being executed.
*/
'quoteIdentifiers' => false,
/**
* During development, if using MySQL < 5.6, uncommenting the
* following line could boost the speed at which schema metadata is
* fetched from the database. It can also be set directly with the
* mysql configuration directive 'innodb_stats_on_metadata = 0'
* which is the recommended value in production environments
*/
//'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],
],
Zaten oluşturduk BitNami WAMP üzerinde duyuyorum CakePhp kurallarına göre işler adlı bir veritabanı tablosu. Kullanıcı testi2, kök yönetici gibi küresel ayrıcalıklara sahiptir.
Ama fırında tüm komuta çalıştırıyorum zaman. Aşağıdaki hatayı
2015-07-01 06:24:56 Error: [PDOException] SQLSTATE[HY000] [1045] Access denied for user 'test2'@'localhost' (using password: YES)
Stack Trace:
C:\Bitnami\wampstack-5.4.40-0\apache2\htdocs\myjobs\vendor\cakephp\cakephp\src\Database\Driver\PDODriverTrait.php(48): PDO->__construct('mysql:host=127....', 'test2', 'computer', Array)
C:\Bitnami\wampstack-5.4.40-0\apache2\htdocs\myjobs\vendor\cakephp\cakephp\src\Database\Driver\Mysql.php(89): Cake\Database\Driver\Mysql->_connect('mysql:host=127....', Array)
C:\Bitnami\wampstack-5.4.40-0\apache2\htdocs\myjobs\vendor\cakephp\cakephp\src\Database\Schema\BaseSchema.php(46): Cake\Database\Driver\Mysql->connect()
SORUN ÇÖZÜLDÜ (GÜNCELLEME) alıyorum
Ben ANKIT ve Spencer'ın yön izledi.
Ben sorunların çift vardı.
Kullanıcımın ana bilgisayarı localhost değildi,% jokerti. Bunu değiştirdi, sonra mysql bağlantıları reddetmeye başladı.
benim güvenlik duvarı devre dışı ve 3306. Yani app.php girişi değişti gelen liman farklı olduğunu gördük. 'Root' & şifreyi:: Artık başvurum pişirilir :)
' Erişim @ (EVET şifreyi kullanarak) 'localhost' kullanıcı 'test2' için reddedildi. _Does_ kullanıcı test2’nin erişimi var mı? Yani Bu çalışır: 'mysql -utest2 -p bilgisayar işleri'? Pasta üzerine krema bu değişikliklerden sonra MySQL yeniden başlatma '%' konak – AD7six
garip, localhost' 'için'% 'değişen gerçekten de başka bir kullanıcı oluşturmak gidebilir ... benim için çalıştı. –
olanı silmek - – dakab