MySQL Issue#1146 - Table 'xxx.xxxxx' doesn't exist
#1

I am running a roleplay gamemode everything works smoothly for around day or even two and the suddenly there is no register no login n0 IG commands and players cannot log in, I tried to check the MySQL files and I've spotted that thre are no datafiles anymore! I tried to check up the MySQL logs of the server and it showed up several #1146 - Table 'xxx.xxxxx' doesn't exist errors, i even tried to change MySQL's I tried to re-install files, I tried to change functions in many ways nothing helped! I really need help I am using hosted server also, I need someone to be close to me and explain me step by step how to solve it.
Reply
#2

which mysql version are you using?
Reply
#3

Quote:
Originally Posted by RallyRally
Посмотреть сообщение
I am running a roleplay gamemode everything works smoothly for around day or even two and the suddenly there is no register no login n0 IG commands and players cannot log in, I tried to check the MySQL files and I've spotted that thre are no datafiles anymore! I tried to check up the MySQL logs of the server and it showed up several #1146 - Table 'xxx.xxxxx' doesn't exist errors, i even tried to change MySQL's I tried to re-install files, I tried to change functions in many ways nothing helped! I really need help I am using hosted server also, I need someone to be close to me and explain me step by step how to solve it.
You should modify the MySQL path under "OnGameModeInIt" on the hosted server.
Reply
#4

Quote:

You should modify the MySQL path under "OnGameModeInIt" on the hosted server.

I did it!

Quote:

which mysql version are you using?

I have no clue I am using Phpmyadmin to import the sql file
Reply
#5

try to restart the mysql server
Reply
#6

I tried, no .sql files in the mysql host

Quote:

You should modify the MySQL path under "OnGameModeInIt" on the hosted server.

Can you please help me

I found some function about mysql under gamemodeinit
Quote:

public OnGameModeInit()
{
//==============================//
TryMe();
//==============================//
sqlconnect();
print("Connected to MySQL werd up.");
//==============================//

Reply
#7

mysql_connect("host_ip", "username", "database_name", "password");

For more info:
https://sampwiki.blast.hk/wiki/MySQL/R33
Reply
#8

If it worked before, then your db is fucked.
Reply
#9

dude it worked only for a day and half and then just stopped working suddenly/
Reply
#10

1. Go and check your database host if is working or not.
2. Recomplie your gamemode.
Reply
#11

Quote:

Go and check your database host if is working or not.
2. Recomplie your gamemode.
__________________

After loading up the datafiles and the gamemode scripts everything works but then after a day or even two the datafiles gets deleted somehow and the no one is able to /register or login the server




Quote:

public OnGameModeInit()
{
//==============================//
TryMe();
//==============================//
sqlconnect();
print("Connected to MySQL werd up.");
handlesql = mysql_connect(MYSQL_HOST,MYSQL_USER,MYSQL_DB,MYSQL _PASS);
if(handlesql) printf("SUCCESS: Connected To MySQL!");
else printf("ERROR: Failed to connect to Mysql!");
return 1;
}

Here is the OnGameModeInit like you said guys, Please help me I can't compile thef file my pawno crashes probably bunch of errors lol
Reply
#12

Make sure any input to database by player is escaped, otherwise they can drop your tables (SQL Injection).
Reply
#13

Quote:

Make sure any input to database by player is escaped, otherwise they can drop your tables (SQL Injection).

I didn't understand shit
Reply
#14

Quote:
Originally Posted by RallyRally
Посмотреть сообщение
I didn't understand shit
What that basically means, is that if you use input given by a player (let's say, their password) without 'escaping' it, they can execute SQL commands through that input. If this is possible, people can delete all data with just one simple command. If you don't use escape functions, this might have happened to you. Ofcourse, someone might have accessed the database/server and deleted the files from there.

If you have a backup of your database you can try and restore that. If you don't have a backup, I'm afraid you have to restore the table structures and start over with everyone's stats. It would be a good idea to make regular database backups to minimalize the damage in such a unfortunate event. You might want to check the logs for any unwanted access or malicious SQL queries if possible, that might help you track down what happened.

Depending on which MySQL plugin you use, be sure to check if something like this function is present in your login/register code (or anywhere else where you use user input in your SQL queries).
Reply
#15

if you took someone elses gamemode maybe they are trolling you like with a timer to drop your tables? i did that to my friend before which just in 2 hours drops the tables. Also if its not trolling maybe you didnt use mysql_escape_strings and when someone types like mysql drop into your password area it just drops your tables? ever thought about those? theres no reason to get tables deleted out of nowhere. No mysql server does that without a command to do so.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)