Jump to content

How to edit a value directly in the database ?


pwired
 Share

Recommended Posts

Hi,

My question is not directly related with processwire but indirectly yes.

I have to change a value in a database of a webshop.

I have never done this before. I have looked many times in databases

with phpmyadmin on servers but never changed a value in a table.

I am sure that for most of you here this is peace a cake

so I was hoping someone can tell me how to do it.

I have to change the value AUTO_INCREMENT; to the new value AUTO_INCREMENT = 101;

If I go in the database to the Table "orders" where I have to be in "order_id"

I see this:

Name       Type         Collation Attributes Null Default       Extra                      Action

order_id   INT(11)                                        No   None         auto_increment

In the column Action there is an edit icon with the word "change",

when I click on that a new window opens where I can edit many things

but I don´t see the value auto_increment nowhere to edit.

What am I missing ?

I know this can be done also with tools like heidi sql

but I really would like to know how to do this directly

in CPanel with phpmyadmin.

Link to comment
Share on other sites

Which shop system is it? Some systems (e.g. Magento) use separate tables that keep track of auto increment values and also have to be updated if this value is changed manually.

Link to comment
Share on other sites

Which shop system is it? Some systems (e.g. Magento) use separate tables that keep track of auto increment values and also have to be updated if this value is changed manually.

The shop system I use is AbanteCart.

The admin has no option to give the id_order a start number or prefix e.g. 100

so I have to do this in the database directly.

With google I found the following:

run this on your mysql

ALTER TABLE `orders` AUTO_INCREMENT = 101;

How do I do this in CPanel under phpmyadmin ?

Link to comment
Share on other sites

Go to the Operations Tab in PMA and there you can adjust the current autoincrement value.

I have only following Tabs in phpmyadmin:

Databases  SQL  Status   Export   Import   Settings   Variables    More

So there is no Operations Tab (or maybe you mean the SQL Tab)

But something tells me I have to open the SQL Tab where I see following:

Run SQL query/queries on server

                                                Go

Do I have to enter here ALTER TABLE `orders` AUTO_INCREMENT = 101;

what I found with google ?

I´ll wait your answers first before I do anything there.

Edit:

On the left side inside phpmyadmin I didn´t select first the target database!

Now I see new Tabs with also the Tab Operations!

Whoa - I did it - both SQL and Operations let you change a table value

ALTER TABLE orders

AUTO_INCREMENT = 15000;

Learned something new about databasing today :)

  • Like 1
Link to comment
Share on other sites

Yes, select the database first from the left menu.

Then you can either click the SQL tab, paste in the code and click Go. Or click on the desired table on the left menu, then click the Operations tab, and change the value in the field as mentioned by adrian.

  • Like 1
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...