Jump to content

database is full


morad kablaoui

Recommended Posts

Good morning,

I have just noticed that my "ns_guest" table has become huge, which makes it impossible for me to add any products or pictures. By searching the forum, most of the contributors say that this table is used for statistics and we can empty it without any problem. Is there a correct way to empty it without affecting the site?

Thanks in advance.

Link to comment
Share on other sites

1 hour ago, morad kablaoui said:

Good morning,

I have just noticed that my "ns_guest" table has become huge, which makes it impossible for me to add any products or pictures. By searching the forum, most of the contributors say that this table is used for statistics and we can empty it without any problem. Is there a correct way to empty it without affecting the site?

Thanks in advance.

Hi. You can run a few commands in the database and you're done. Information about the Prestashop version and the table prefix is missing here. Then I can give you the commands to run in phpMyAdmin.

Link to comment
Share on other sites

4 minutes ago, Daresh said:

PrestaShop version should have nothing to do with being able or not to install a module. What happens when you try to install anything?

he told me I couldn't do that, and now I can't open my dashboard i try to log in with all accounts and not logging in he told me that "The Employee does not exist, or the password provided is incorrect."

Capture d'écran 2023-12-21 165708.png

Edited by morad kablaoui (see edit history)
Link to comment
Share on other sites

3 hours ago, Daresh said:

PrestaShop version should have nothing to do with being able or not to install a module. What happens when you try to install anything?

Note that it has a full database and therefore cannot write anything from the module's configuration. You advise complete nonsense and you are responsible for the damage, since you recommended it. If the interviewer answered me, he might have problems.

Link to comment
Share on other sites

3 hours ago, morad kablaoui said:

he told me I couldn't do that, and now I can't open my dashboard i try to log in with all accounts and not logging in he told me that "The Employee does not exist, or the password provided is incorrect."

Capture d'écran 2023-12-21 165708.png

You've gotten to the point where you're going to have to pay a developer to help you fix everything.

Link to comment
Share on other sites

Indeed, if the database is full you may have some issues logging in.

What you can try, is to clear the search index manually. It is also often a lot of data. It can be rebuilt manually after you gain some additional space. It's _search_index and _search_word tables.

Link to comment
Share on other sites

13 hours ago, Daresh said:

Indeed, if the database is full you may have some issues logging in.

What you can try, is to clear the search index manually. It is also often a lot of data. It can be rebuilt manually after you gain some additional space. It's _search_index and _search_word tables.

When I search in phpmyadmin, I find a table called "ns_guest" it is very large, can I drop it ?

Link to comment
Share on other sites

TRUNCATE TABLE `ns_guest`;

/* delete CONNECTIONS records younger than 2023-01-01 */
DELETE FROM `ns_connections` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_page` WHERE `time_start` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_source` WHERE `date_add` < '2023-01-01 00:00:00';

/* delete LOG records younger than 2023-01-01 */
DELETE FROM `ns_log` WHERE `date_add` < '2023-01-01 00:00:00';

/* delete PAGE NOT FOUND records younger than 2023-01-01*/
DELETE FROM `ns_pagenotfound` WHERE `date_add` < '2023-01-01 00:00:00';

 

Edited by ps8moduly.cz (see edit history)
Link to comment
Share on other sites

14 minutes ago, ps8moduly.cz said:
TRUNCATE TABLE `ns_guest`;
/* delete records younger than 2023-01-01 */
DELETE FROM `ns_connections` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_page` WHERE `time_start` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_source` WHERE `date_add` < '2023-01-01 00:00:00';

 

when I well use this?

 

Link to comment
Share on other sites

And you need to know who joined your e-shop ten years ago and what pages they visited?

Do you want to have a partially optimized database?
Do you need to write to the database?
Older records need to be deleted!

The commands I gave you here are also included in various modules for cleaning the database.

You can, of course, adjust the date in SQL.

Edited by ps8moduly.cz (see edit history)
Link to comment
Share on other sites

That's why I recommend deleting only old data, not all data. Some users complain that after clearing the guest table totally, the carts are not loaded. Loading carts may depend on the guest table (depending on PrestaShop version, I don't remember it now exactly).

I would modify the above queries this way:

DELETE FROM `ns_connections` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_page` WHERE `time_start` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_source` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_guest` WHERE `id_guest` NOT IN (SELECT `id_guest` FROM `ns_connections`) AND `id_customer` = 0

 

Link to comment
Share on other sites

8 minutes ago, Daresh said:

That's why I recommend deleting only old data, not all data. Some users complain that after clearing the guest table totally, the carts are not loaded. Loading carts may depend on the guest table (depending on PrestaShop version, I don't remember it now exactly).

I would modify the above queries this way:

DELETE FROM `ns_connections` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_page` WHERE `time_start` < '2023-01-01 00:00:00';
DELETE FROM `ns_connections_source` WHERE `date_add` < '2023-01-01 00:00:00';
DELETE FROM `ns_guest` WHERE `id_guest` NOT IN (SELECT `id_guest` FROM `ns_connections`) AND `id_customer` = 0

 

Guys, can you explain to me exactly what this SQL code does, and sorry for the inconvenience

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...