Solved Mysql Problem

Installation Problems Support
Post Reply
User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

Mysql Problem

#1

Post by Luxurious » 4 years ago

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)
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#2

Post by Raheem » 4 years ago

This because remote connection not enabled i think (Not sure), the database installed on same machine you host your server on?
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#3

Post by Luxurious » 4 years ago

i using linux and i using the Open Game Panel and the Mysql is Showing me is Online !
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#4

Post by Raheem » 4 years ago

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.
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#5

Post by Luxurious » 4 years ago

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 !
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#6

Post by Raheem » 4 years ago

OK, open putty and login then run these respectively:
    1. mysql -u root -p
    2. CREATE DATABASE coinsdb;
    3. CREATE USER 'coinsadmin'@localhost IDENTIFIED BY 'Gt3F35663';
    4. use coinsdb;
    5. GRANT ALL PRIVILEGES ON coinsdb.* TO 'coinsadmin'@localhost;
    6. GRANT ALL ON *.* to coinsadmin@'127.0.0.1' IDENTIFIED BY 'Gt3F35663';
    7. 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:
    1. ze_ec_host "127.0.0.1"          // Database ip
    2. ze_ec_user "coinsadmin"         // Database account username
    3. ze_ec_pass "Gt3F356@63"         // Database account password
    4. 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.
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#7

Post by Luxurious » 4 years ago

Raheem wrote: 4 years ago OK, open putty and login then run these respectively:
    1. mysql -u root -p
    2. CREATE DATABASE coinsdb;
    3. CREATE USER 'coinsadmin'@localhost IDENTIFIED BY 'Gt3F356@63';
    4. use coinsdb;
    5. GRANT ALL PRIVILEGES ON coinsdb.* TO 'coinsadmin'@localhost;
    6. 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:
    1. ze_ec_host "127.0.0.1"          // Database ip
    2. ze_ec_user "coinsadmin"         // Database account username
    3. ze_ec_pass "Gt3F356@63"         // Database account password
    4. 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 !
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#8

Post by Raheem » 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. Try password like 12345678
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#9

Post by Luxurious » 4 years ago

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 !
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

User avatar
Raheem
Mod Developer
Mod Developer
Posts: 2214
Joined: 7 years ago
Contact:

#10

Post by Raheem » 4 years ago

No problem, but why OGP uses database?
He who fails to plan is planning to fail

User avatar
Luxurious
Mod Tester
Mod Tester
Egypt
Posts: 177
Joined: 6 years ago
Location: Egypt
Contact:

#11

Post by Luxurious » 4 years ago

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 ...
DRK Zombie-Escape V1.6
IP : 81.169.153.129:27015

Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Who is online

Users browsing this forum: No registered users and 3 guests