Page 1 of 1
Mysql Problem
Posted: 05 Aug 2019, 20:15
by Luxurious
Hello Guys , I have some problem when i make the level/Coins Save by Mysql that what i got
Code: Select all
L 08/05/2019 - 21:05:42: [AMXX] Plugin says: Failed to connect to MySQL database: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
Re: Mysql Problem
Posted: 05 Aug 2019, 20:18
by Raheem
This because remote connection not enabled i think (Not sure), the database installed on same machine you host your server on?
Re: Mysql Problem
Posted: 05 Aug 2019, 20:19
by Luxurious
i using linux and i using the Open Game Panel and the Mysql is Showing me is Online !
Re: Mysql Problem
Posted: 05 Aug 2019, 20:33
by Raheem
Open game panel does not use MySQL.
Give more information, where MySQL installed? And where your server installed? They are on same machine?
If so, then make sure that MySQL running and also make sure that user/pass/database exists and also right permissions given for the user that will access the database.
Re: Mysql Problem
Posted: 05 Aug 2019, 20:37
by Luxurious
The Mysql and server in the one vps !
the Msql is showing in Msql Administrator " MySQL server name: root Server status: Online / MySQL online"
i don`t know about the access !
Re: Mysql Problem
Posted: 05 Aug 2019, 20:49
by Raheem
OK, open putty and login then run these respectively:
mysql -u root -p
CREATE DATABASE coinsdb;
CREATE USER 'coinsadmin'@localhost IDENTIFIED BY 'Gt3F35663';
use coinsdb;
GRANT ALL PRIVILEGES ON coinsdb.* TO 'coinsadmin'@localhost;
GRANT ALL ON *.* to coinsadmin@'127.0.0.1' IDENTIFIED BY 'Gt3F35663';
exit
This assumed to make database with name coinsdb and create user to access it which is coinsadmin with password Gt3F356 and also this user have all privileges.
Just now restart MySQL,
sudo service mysql restart
assuming Ubuntu.
Now you can use:
ze_ec_host "127.0.0.1" // Database ip
ze_ec_user "coinsadmin" // Database account username
ze_ec_pass "Gt3F356@63" // Database account password
ze_ec_dbname "coinsdb" // Database name
VERY IMPORTANT: MAKE SURE TO USE '127.0.0.1' NOT 'localhost' - AMXMODX is stupid enough and can't resolve the DNS in most cases.
Re: Mysql Problem
Posted: 05 Aug 2019, 21:02
by Luxurious
Raheem wrote: ↑4 years ago
OK, open putty and login then run these respectively:
mysql -u root -p
CREATE DATABASE coinsdb;
CREATE USER 'coinsadmin'@localhost IDENTIFIED BY 'Gt3F356@63';
use coinsdb;
GRANT ALL PRIVILEGES ON coinsdb.* TO 'coinsadmin'@localhost;
exit
This assumed to make database with name coinsdb and create user to access it which is coinsadmin with password Gt3F356 and also this user have all privileges.
Just now restart MySQL,
sudo service mysql restart
assuming Ubuntu.
Now you can use:
ze_ec_host "127.0.0.1" // Database ip
ze_ec_user "coinsadmin" // Database account username
ze_ec_pass "Gt3F356@63" // Database account password
ze_ec_dbname "coinsdb" // Database name
VERY IMPORTANT: MAKE SURE TO USE '127.0.0.1' NOT 'localhost' - AMXMODX is stupid enough and can't resolve the DNS in most cases.
Code: Select all
L 08/05/2019 - 23:00:46: [AMXX] Plugin says: Failed to connect to MySQL database: Access denied for user 'coinsadmin'@'localhost' to database 'coinsdb'
i did but i got this problem !
Re: Mysql Problem
Posted: 05 Aug 2019, 21:06
by Raheem
This means that password not right, or this user have no permissions.
Password length should be < 30 characters.
Try change the password for the user and try again. Try password like 12345678
Re: Mysql Problem
Posted: 05 Aug 2019, 21:07
by Luxurious
Raheem wrote: ↑4 years ago
This means that password not right, or this user have no permissions.
Password length should be < 30 characters.
Try change the password for the user and try again.
i have used the mySQL of the ogp and it worked fine !
Thx For Try to help me !
Re: Mysql Problem
Posted: 05 Aug 2019, 21:09
by Raheem
No problem, but why OGP uses database?
Re: Mysql Problem
Posted: 06 Aug 2019, 07:57
by Luxurious
Raheem wrote: ↑4 years ago
No problem, but why OGP uses database?
To Save the users and remote servers and rcon presents and many things ...