Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] - esx_script - Issue #1405

Closed
jaimelpdev opened this issue Sep 28, 2024 · 5 comments
Closed

[Bug] - esx_script - Issue #1405

jaimelpdev opened this issue Sep 28, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@jaimelpdev
Copy link

hi everyone,
I have this problem, someone can help me?
imagen_2024-09-28_121859903

@jaimelpdev jaimelpdev added the bug Something isn't working label Sep 28, 2024
@Gellipapa
Copy link
Member

Hi! @jaimelpdev Run this SQL on your users table.

ALTER TABLE usersADD COLUMN last_property VARCHAR(255) NULL DEFAULT

@jaimelpdev
Copy link
Author

I did it now and the error persist.

@Gellipapa
Copy link
Member

@jaimelpdev Hi! It's okey, go to esx_property/server.lua find this row
"ALTER TABLE users ADD COLUMN IF NOT EXISTS last_property LONGTEXT NULL"
and remove "IF NOT EXIST" part.

Good query is: ALTER TABLE users ADD COLUMN last_property LONGTEXT NULL

After restart esx_property and it's works. I think you are use old mysql engine and your mysql version don't have "IF NOT EXISTS" logic.

Solution update your sql or replace query.

@jaimelpdev
Copy link
Author

Now the error dissapears, but when I was entry to the FiveM's server this error appears:
image

@Gellipapa
Copy link
Member

@jaimelpdev Hi! It's okey, you should run this query on your SQL. (like phpmyadmin, or heidisql)
IMPORTANT first delete all users table. If you have any data, first of all export your database, after delete table and run this query, after you can import database and you get all latest data.

But all this shouldn't happen if you don't install ESX manually but through txadmin because then everything is done automatically and correctly by txadmin. Now specifically your database is probably broken in several places, I would suggest you reinstall it all via txadmin by entering the SQL data and txadmin will run the SQL queries.

CREATE TABLE IF NOT EXISTS `users` (
  `identifier` varchar(46) NOT NULL,
  `accounts` longtext DEFAULT NULL,
  `group` varchar(50) DEFAULT 'user',
  `inventory` longtext DEFAULT NULL,
  `job` varchar(20) DEFAULT 'unemployed',
  `job_grade` int(11) DEFAULT 0,
  `loadout` longtext DEFAULT NULL,
  `metadata` longtext DEFAULT NULL,
  `position` longtext DEFAULT NULL,
  `firstname` varchar(16) DEFAULT NULL,
  `lastname` varchar(16) DEFAULT NULL,
  `dateofbirth` varchar(10) DEFAULT NULL,
  `sex` varchar(1) DEFAULT NULL,
  `height` int(11) DEFAULT NULL,
  `skin` longtext DEFAULT NULL,
  `status` longtext DEFAULT NULL,
  `is_dead` tinyint(1) DEFAULT 0,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `disabled` tinyint(1) DEFAULT 0,
  `last_property` varchar(255) DEFAULT NULL,
  `last_property2` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT current_timestamp(),
  `last_seen` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  `phone_number` varchar(20) DEFAULT NULL,
  `pincode` int(11) DEFAULT NULL,
  `last_property10` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`identifier`),
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;

@Gellipapa Gellipapa reopened this Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants