Problem with MYSQL
#1

hi,also i have this problem https://sampforum.blast.hk/showthread.php?tid=431630 , New users cant create account and old accounts can join to server,
problem is with this codes , what is wrong ?i showed codes here
Code:
CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `name` varchar(25) NOT NULL,
  `password` varchar(50) NOT NULL,
  `Level` int(3) NOT NULL DEFAULT '0',
  `Admin` int(2) NOT NULL DEFAULT '0',
  `Helper` int(2) NOT NULL DEFAULT '0',
  `IP` varchar(20) NOT NULL DEFAULT '127.0.0.1'
  `Premium` int(2) NOT NULL DEFAULT '0',
  `Beta` int(2) NOT NULL DEFAULT '0',
  `Support` int(3) NOT NULL DEFAULT '0',
  `ConnectedTime` int(11) NOT NULL DEFAULT '0',
  `Registered` int(2) NOT NULL DEFAULT '0',
  `Sex` int(2) NOT NULL DEFAULT '0',
  `Age` int(3) NOT NULL DEFAULT '0',
  `Origin` int(2) NOT NULL DEFAULT '1',
  `Muted` int(2) NOT NULL DEFAULT '0',
  `MuteTime` int(11) NOT NULL DEFAULT '0',
  `Respect` int(11) NOT NULL DEFAULT '0',
  `Money` int(11) NOT NULL DEFAULT '0',
  `Bank` int(11) NOT NULL DEFAULT '0',
  `Crimes` int(11) NOT NULL DEFAULT '0',
  `Kills` int(11) NOT NULL DEFAULT '0',
  `Deaths` int(11) NOT NULL DEFAULT '0',
  `Arrested` int(11) NOT NULL DEFAULT '0',
  `WantedDeaths` int(11) NOT NULL DEFAULT '0',
  `Phonebook` int(2) NOT NULL DEFAULT '0',
  `WantedLevel` int(11) NOT NULL DEFAULT '0',
  `Fishes` int(3) NOT NULL DEFAULT '0',
  `Job` int(3) NOT NULL DEFAULT '0',
  `Paycheck` int(11) NOT NULL DEFAULT '0',
  `HeadValue` int(11) NOT NULL DEFAULT '0',
  `Jailed` int(2) NOT NULL DEFAULT '0',
  `JailTime` int(11) NOT NULL DEFAULT '0',
  `dm` int(3) NOT NULL DEFAULT '0',
  `dmp` int(3) NOT NULL DEFAULT '0',
  `Materials` int(11) NOT NULL DEFAULT '0',
  `Drugs` int(11) NOT NULL DEFAULT '0',
  `Leader` int(3) NOT NULL DEFAULT '0',
  `Member` int(3) NOT NULL DEFAULT '0',
  `Rank` int(2) NOT NULL DEFAULT '0',
  `FWarn` int(2) NOT NULL DEFAULT '0',
  `FPunish` int(4) NOT NULL DEFAULT '0',
  `Acceptpoints` int(2) NOT NULL DEFAULT '0',
  `pHealth` float NOT NULL,
  `Inter` int(3) NOT NULL DEFAULT '0',
  `Local` int(11) NOT NULL DEFAULT '0',
  `Team` int(3) NOT NULL DEFAULT '0',
  `Model` int(11) NOT NULL,
  `PhoneNr` int(5) NOT NULL DEFAULT '0',
  `PhoneCredits` int(4) NOT NULL DEFAULT '0',
  `House` int(11) NOT NULL DEFAULT '0',
  `Bizz` int(11) NOT NULL DEFAULT '0',
  `Pos_x` float NOT NULL,
  `Pos_y` float NOT NULL,
  `Pos_z` float NOT NULL,
  `Rob` int(11) NOT NULL DEFAULT '0',
  `GunLicSuspend` int(3) NOT NULL DEFAULT '0',
  `CarLicSuspend` int(3) NOT NULL DEFAULT '0',
  `CarLicT` int(11) NOT NULL DEFAULT '0',
  `CarLic` int(2) NOT NULL DEFAULT '0',
  `FlyLicT` int(11) NOT NULL DEFAULT '0',
  `FlyLic` int(2) NOT NULL DEFAULT '0',
  `BoatLicT` int(11) NOT NULL DEFAULT '0',
  `BoatLic` int(2) NOT NULL DEFAULT '0',
  `FishLicT` int(11) NOT NULL DEFAULT '0',
  `FishLic` int(2) NOT NULL DEFAULT '0',
  `GunLicT` int(11) NOT NULL DEFAULT '0',
  `GunLic` int(2) NOT NULL DEFAULT '0',
  `PayDay` int(20) NOT NULL DEFAULT '0',
  `PayDayHad` int(20) NOT NULL DEFAULT '0',
  `Tutorial` int(2) NOT NULL DEFAULT '0',
  `Warnings` int(2) NOT NULL DEFAULT '0',
  `Rented` int(111) NOT NULL DEFAULT '0',
  `Fuel` int(11) NOT NULL DEFAULT '0',
  `WTalkie` int(2) NOT NULL DEFAULT '0',
  `Tow` int(20) NOT NULL DEFAULT '0',
  `Email` varchar(50) NOT NULL DEFAULT 'email@yahoo.com',
  `RegisterDate` varchar(50) NOT NULL DEFAULT '00-00-0000 00:00:00',
  `lastOn` varchar(50) NOT NULL DEFAULT '00-00-0000 00:00:00',
  `Victim` varchar(64) NOT NULL,
  `Status` int(11) NOT NULL DEFAULT '0',
  `HitT` int(20) NOT NULL DEFAULT '0',
  `Phone` int(11) NOT NULL DEFAULT '0',
  `Carkey` int(11) NOT NULL DEFAULT '0',
  `motokey` int(11) NOT NULL DEFAULT '0',
  `helikey` int(11) NOT NULL DEFAULT '0',
  `prcarkey` int(11) NOT NULL DEFAULT '0',
  `Accused` varchar(64) NOT NULL DEFAULT '********',
  `Crime1` varchar(184) NOT NULL DEFAULT 'Fara',
  `Crime2` varchar(184) NOT NULL DEFAULT 'Fara',
  `Crime3` varchar(184) NOT NULL DEFAULT 'Fara',
  `Fakea` int(11) NOT NULL DEFAULT '0',
  `ALeader` int(11) NOT NULL DEFAULT '0',
  `HPoints` int(11) NOT NULL DEFAULT '0',
  `Language` int(2) NOT NULL DEFAULT '0',
  `rpgon` int(11) NOT NULL DEFAULT '0',
  `PremiumPoints` int(11) NOT NULL DEFAULT '0',
  `FWorks` int(11) NOT NULL DEFAULT '0',
  `prcarkey2` int(11) NOT NULL DEFAULT '0',
  `pluscarkey` int(11) NOT NULL DEFAULT '0',
  `pluscarkey2` int(11) NOT NULL DEFAULT '0',
  `pluscarkey3` int(11) NOT NULL DEFAULT '0',
  `PlusSlot1` int(11) NOT NULL DEFAULT '0',
  `PlusSlot2` int(11) NOT NULL DEFAULT '0',
  `VirtualPD` int(11) NOT NULL DEFAULT '0',
  `Glasses` int(11) NOT NULL DEFAULT '0',
  `Hats` int(11) NOT NULL DEFAULT '0',
  `GiftBoxTime` int(11) NOT NULL DEFAULT '0',
  `SpawnChange` int(11) NOT NULL DEFAULT '0',
  `RobSkill` int(11) NOT NULL DEFAULT '1',
  `RobTimes` int(11) NOT NULL DEFAULT '0',
  `RobRem` int(11) NOT NULL DEFAULT '26',
  `FishSkill` int(11) NOT NULL DEFAULT '1',
  `FishTimes` int(11) NOT NULL DEFAULT '0',
  `FishRem` int(11) NOT NULL DEFAULT '26',
  `TruckSkill` int(11) NOT NULL DEFAULT '1',
  `TruckTimes` int(11) NOT NULL DEFAULT '0',
  `TruckRem` int(11) NOT NULL DEFAULT '26',
  `FarmSkill` int(11) NOT NULL DEFAULT '1',
  `FarmTimes` int(11) NOT NULL DEFAULT '0',
  `FarmRem` int(11) NOT NULL DEFAULT '26',
  `PizzaSkill` int(2) NOT NULL DEFAULT '1',
  `PizzaRem` int(5) NOT NULL DEFAULT '26',
  `PizzaTimes` int(11) NOT NULL DEFAULT '0',
  `ArmsSkill` int(2) NOT NULL DEFAULT '1',
  `ArmsRem` int(5) NOT NULL DEFAULT '26',
  `ArmsTimes` int(11) NOT NULL DEFAULT '0',
  `BusSkill` int(2) NOT NULL DEFAULT '1',
  `BusRem` int(5) NOT NULL DEFAULT '26',
  `BusTimes` int(11) NOT NULL DEFAULT '0',
  `Gifti` int(11) NOT NULL,
  `FactionTime` int(11) NOT NULL,
  `CreditsF` int(11) NOT NULL,
  `NMuted` int(11) NOT NULL DEFAULT '0',
  `HelpedPlayers` int(11) NOT NULL DEFAULT '0',
  `HiddenColor` int(11) NOT NULL DEFAULT '0',
  `GiftTime` int(11) NOT NULL DEFAULT '0',
  `PhoneBlock` int(11) NOT NULL DEFAULT '0',
  `Host` int(11) NOT NULL DEFAULT '0',
  `FightStyle` int(11) NOT NULL DEFAULT '0',
  `HUD1` int(11) NOT NULL DEFAULT '0',
  `HUD2` int(11) NOT NULL DEFAULT '0',
  `HUD3` int(11) NOT NULL DEFAULT '0',
  `Clan` int(4) NOT NULL DEFAULT '0',
  `CRank` int(2) NOT NULL DEFAULT '0',
  `ClanTag` int(2) NOT NULL DEFAULT '0',
  `ClanTime` int(11) NOT NULL DEFAULT '0',
  `ClanJoin` varchar(64) NOT NULL DEFAULT '0',
  `FactionJoin` varchar(64) NOT NULL DEFAULT '0',
  `ClanWarns` int(2) NOT NULL DEFAULT '0',
  `OnlineToday` int(2) NOT NULL DEFAULT '0',
  `OnlineThisWeek` int(2) NOT NULL DEFAULT '0',
  `OnlineLastWeek` int(2) NOT NULL DEFAULT '0',
  `LastIP` varchar(20) NOT NULL DEFAULT '0',
  `GasCan` int(2) NOT NULL DEFAULT '0',
  `Quest0` int(1) NOT NULL DEFAULT '0',
  `Quest1` int(1) NOT NULL DEFAULT '0',
  `Quest2` int(1) NOT NULL DEFAULT '0',
  `Quest3` int(1) NOT NULL DEFAULT '0',
  `Quest4` int(1) NOT NULL DEFAULT '0',
  `Quest5` int(1) NOT NULL DEFAULT '0',
  `Quest6` int(1) NOT NULL DEFAULT '0',
  `Quest7` int(1) NOT NULL DEFAULT '0',
  `Quest8` int(1) NOT NULL DEFAULT '0',
  `Quest9` int(1) NOT NULL DEFAULT '0',
  `Quest10` int(1) NOT NULL DEFAULT '0',
  `Quest11` int(1) NOT NULL DEFAULT '0',
  `Quest12` int(1) NOT NULL DEFAULT '0',
  `Quest13` int(1) NOT NULL DEFAULT '0',
  `Quest14` int(1) NOT NULL DEFAULT '0',
  `Quest15` int(1) NOT NULL DEFAULT '0',
  `Quest16` int(1) NOT NULL DEFAULT '0',
  `Quest17` int(1) NOT NULL DEFAULT '0',
  `Quest18` int(1) NOT NULL DEFAULT '0',
  `Quest19` int(1) NOT NULL DEFAULT '0',
  `Quest20` int(1) NOT NULL DEFAULT '0',
  `Quest21` int(1) NOT NULL DEFAULT '0',
  `Quest22` int(1) NOT NULL DEFAULT '0',
  `Quest23` int(1) NOT NULL DEFAULT '0',
  `Quest24` int(1) NOT NULL DEFAULT '0',
  `Quest25` int(1) NOT NULL DEFAULT '0',
  `Quest26` int(1) NOT NULL DEFAULT '0',
  `Quest27` int(1) NOT NULL DEFAULT '0',
  `Quest28` int(1) NOT NULL DEFAULT '0',
  `Quest29` int(1) NOT NULL DEFAULT '0',
  `Quest30` int(1) NOT NULL DEFAULT '0',
  `Quest31` int(1) NOT NULL DEFAULT '0',
  `Quest32` int(1) NOT NULL DEFAULT '0',
  `Quest33` int(1) NOT NULL DEFAULT '0',
  `Quest34` int(1) NOT NULL DEFAULT '0',
  `Quest35` int(1) NOT NULL DEFAULT '0',
  `Quest36` int(1) NOT NULL DEFAULT '0',
  `Quest37` int(1) NOT NULL DEFAULT '0',
  `Quest38` int(1) NOT NULL DEFAULT '0',
  `Quest39` int(1) NOT NULL DEFAULT '0',
  `Quest40` int(1) NOT NULL DEFAULT '0',
  `Quest41` int(1) NOT NULL DEFAULT '0',
  `Quest42` int(1) NOT NULL DEFAULT '0',
  `Quest43` int(1) NOT NULL DEFAULT '0',
  `Quest44` int(1) NOT NULL DEFAULT '0',
  `Quest45` int(1) NOT NULL DEFAULT '0',
  `Quest46` int(1) NOT NULL DEFAULT '0',
  `Quest47` int(1) NOT NULL DEFAULT '0',
  `Quest48` int(1) NOT NULL DEFAULT '0',
  `Quest49` int(1) NOT NULL DEFAULT '0',
  `playerColor` int(11) NOT NULL DEFAULT '0',
  `SecSkin` int(11) NOT NULL,
  `FRIST IP` varchar(20) NOT NULL,
  `Blocked` int(11) NOT NULL,
  `Tokens` int(11) NOT NULL,
  `VIP` int(11) NOT NULL,
  `TotalDonatedPP` int(11) NOT NULL,
  `HUD4` int(11) NOT NULL,
  `SkillCoal` int(11) NOT NULL DEFAULT '1',
  `RemainCoal` int(11) NOT NULL DEFAULT '25',
  `TransportateCoal` int(11) NOT NULL DEFAULT '0',
  `MoneyD` int(11) NOT NULL,
  `Runners` int(11) NOT NULL,
  `PHeals` int(11) NOT NULL,
  `LGiven` int(11) NOT NULL,
  `WKills` int(11) NOT NULL,
  `WDeaths` int(11) NOT NULL,
  `MUsed` int(11) NOT NULL,
  `DDeposit` int(11) NOT NULL,
  `MDeposit` int(11) NOT NULL,
  `News` int(11) NOT NULL,
  `Lives` int(11) NOT NULL,
  `Orders` int(11) NOT NULL,
  `Contracts` int(11) NOT NULL,
  `DConfiscate` int(11) NOT NULL,
  `LConfiscate` int(11) NOT NULL,
  `Tickets` int(11) NOT NULL,
  `Arrests` int(11) NOT NULL,
  `Misiune` int(11) NOT NULL,
  `Misiune2` int(11) NOT NULL,
  `CerinteMisiune` int(11) NOT NULL,
  `CerinteMisiune2` int(11) NOT NULL,
  `ProgresMisiune` int(11) NOT NULL,
  `ProgresMisiune2` int(11) NOT NULL,
  `MisiuneTerminata` int(11) NOT NULL,
  `MisiuneTerminata2` int(11) NOT NULL,
  `PaintRank` int(11) NOT NULL,
  `PaintKills` int(11) NOT NULL,
  `Note` text NOT NULL,
  `NoteBy` varchar(100) NOT NULL,
  `LastUp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `Reports` varchar(11) NOT NULL,
  `ATickets` varchar(11) NOT NULL,
  `NRE` varchar(11) NOT NULL,
  `SecurityModeratorSupport` int(11) NOT NULL,
  `Function` varchar(25) NOT NULL DEFAULT '(null)',
  `PaintRankName` varchar(512) NOT NULL DEFAULT 'UNRANKED',
  `CarPlus` int(11) NOT NULL,
  `CarPlus2` int(11) NOT NULL,
  `*******r` int(2) DEFAULT NULL,
  `link` varchar(100) NOT NULL DEFAULT 'https://*******.com/'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
[10:12:00] Error ID: 1364, Error: Field 'IP' doesn't have a default value
Reply
#2

Are you sure you import that code? I see no problem with 'IP' field,post a screenshot of your field in phpmyadmin maybe?
Reply
#3

The table has been created. No matter how many times you modify the query above and execute it, it will fail because there is already a table with this name. Next time, use
pawn Code:
ALTER TABLE users MODIFY [COLUMN] col_name column_definition;
so your changes will take effect.

PS: You have many columns, many of those can be split to multiple tables.
Reply
#4

Problem Is Solved... Thanks
Reply
#5

You are meant to replace them with the data you want. In your case:
pawn Code:
ALTER TABLE users MODIFY IP varchar(20) NOT NULL DEFAULT '127.0.0.1';
Reply
#6

Off: What is wrong with people though,didn't read the reply(I meant what he say) and just straight up paste the code.
Reply
#7

Quote:
Originally Posted by Verc
View Post
Off: What is wrong with people though,didn't read the reply(I meant what he say) and just straight up paste the code.
Quote:
Originally Posted by marshmallow
View Post
Looking for one to recovery my database i have just .frm and .idb files
Is it though? Is it REAAALLLYYYY though?





People need to stop looking for the quick fix and start realizing that scripting, isn't just slapping shit together, as if you do slap shit together, all you'll still get is shit.
Reply
#8

Quote:
Originally Posted by marshmallow
View Post
Looking for one to recovery my database i have just .frm and .idb files
Since once I had the same problem and solved it by following these steps and so did marshmallow, I'm going to post the link as a reference to anybody else.

https://dba.stackexchange.com/questi...from-ibd-files
Reply
#9

That still doesn't address the point of not blindly following guesses, and people simply throwing up answers without checking that it is what they think it is...

After all, this in particular is very dangerous, working with a database, not knowing what you are doing, and simply throwing in random queries on a whim that it MAY work.

MySQL can do a lot more than checking data, it can delete them as well.



Not to mention, the forum is for sharing... Would you have even come back in there to explain the 'solution' unless I had pointed the issue out?

I highly think you wouldn't have, and this would've been one of those threads that has no 'end', yet the person didn't come back to that thread...

And this goes back to the OP as well... Same deal.Claims it's fixed, discovers it's not, still proceed to post elsewhere rather than hitting up the forum thread where everyone who was helping, is looking...



So has the OP actually 'fixed' the issue, or are they simply not responding to the thread where they should be posting more feedback about what the problem is, or saying that they actually fixed it.... (Them posting in the Looking for Scripters thread, contradicts any perception that it's fixed at all.
Reply
#10

Quote:
Originally Posted by Sew_Sumi
View Post
Not to mention, the forum is for sharing... Would you have even come back in there to explain the 'solution' unless I had pointed the issue out?

I highly think you wouldn't have, and this would've been one of those threads that has no 'end', yet the person didn't come back to that thread...

And this goes back to the OP as well... Same deal.Claims it's fixed, discovers it's not, still proceed to post elsewhere rather than hitting up the forum thread where everyone who was helping, is looking...



So has the OP actually 'fixed' the issue, or are they simply not responding to the thread where they should be posting more feedback about what the problem is, or saying that they actually fixed it.... (Them posting in the Looking for Scripters thread, contradicts any perception that it's fixed at all.
They are completely different issues. He was modifying the CREATE TABLE and he was thinking it will take effect but table already exists and he had to use ALTER TABLE.

The problem he asked in the other thread is for recovering a database, it may not be related at all with his current database. It might have been an old database he had and no backups but just those files.

Or even a problem with manager software (WAMP/XAMPP etc) and what not. Trying to upgrade mysql is not an easy task and requires you to have "data" folder as a backup. However, installing the manager in another path/using another Windows User will completely break the contents of that folder and will not work. If no exports, these files are the only solution.

I sent him a personal message on how to recover the database so he will not waste his money. You, posting it here is irrelevant and off-topic and since you did, I decided to do as well with the fix included.

At the end of the day, recovery of database is not related to samp indirectly. There are sites with great answers (such as stackoverflow/stackexchange).
Reply
#11

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
They are completely different issues.
And yet you go on for the entire page on that different issue from what I am pointing out. Let me retort.

Copy pasting code can only get you so far, and many times it will leave you with a symptom fixed, and not the main cause.

When you read SQL queries back to yourself, it makes sense, but in that same token, if someone had actually thrown up a bad SQL query, would they have blindly run it, hoping for a sake of 'fixing' it?

I'd almost be certain, that a few currently would.

To add to this, you're discounting the damage that you could do, by using the wrong query through the script (It would be pretty hard to actually do) against the database.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)