3 on Linux server and there is requirement to change host name, is there any changes need to be done at Maria Db side after server name changed?

|
roritoH 2019-11-16 17:53:49
Hey, i’ve an issue with mysql not running at all on my mac
roritoH 2019-11-16 17:53:56
if anyone could help that would be great
piterden 2019-11-16 17:55:21
How do you want we to help?
roritoH 2019-11-16 18:02:04
if anyone’s willing to look into the problem i can share my screen
piterden 2019-11-16 18:14:04
roritoH 2019-11-16 18:02:04
if anyone’s willing to look into the problem i can share my screen

Could you please make a detailed description of your issue with screenshots or even a video if it would be needed?

myawesomeusername 2019-11-18 15:54:20
Hello, i am facing a problem here. I would really appreciate if anyone could help!

I have a stock table, I need to update it if required amount of products are available only. Should I use SELECT FOR UPDATE statement or following query will be just fine?
UPDATE stock set soldOut = soldOut + 4 where stockId = 1 and available >= soldOut + 4;

MasterZiv 2019-11-18 15:55:16
myawesomeusername 2019-11-18 15:54:20
Hello, i am facing a problem here. I would really appreciate if anyone could help!

I have a stock table, I need to update it if required amount of products are available only. Should I use SELECT FOR UPDATE statement or following query will be just fine?
UPDATE stock set soldOut = soldOut + 4 where stockId = 1 and available >= soldOut + 4;

you can use only UPDATE

myawesomeusername 2019-11-18 15:55:37
this one is OK then?
MasterZiv 2019-11-18 15:56:06
myawesomeusername 2019-11-18 15:55:37
this one is OK then?

I don’t see any problem

myawesomeusername 2019-11-18 15:56:21
Thank you!
smlkw 2019-11-18 16:36:42
myawesomeusername 2019-11-18 15:56:21
Thank you!

It seems you’re an Azerbaijani. Here is a chat in Russian too. If you’d like I can share it.

myawesomeusername 2019-11-18 16:40:09
Yes, I am Azerbaijani. But I am not that fluent in Russian. Thank you anyway.
myawesomeusername 2019-11-18 17:10:09
MasterZiv 2019-11-18 15:56:06
I don’t see any problem

Are you 100% sure that it won’t cause any nasty bugs? I found related question in SO. Please have a look.
https://stackoverflow.com/questions/4358732/is-incrementing-a-field-in-mysql-atomic

Is incrementing a field in MySQL atomic?Stack Overflow
I’m making a web site where I would like to increment a counter in a standard MyISAM table.

Simplified example:

UPDATE votes SET num = num + 1;
Will this cause problems if multiple connections are

MasterZiv 2019-11-18 17:11:39
myawesomeusername 2019-11-18 17:10:09
Are you 100% sure that it won’t cause any nasty bugs? I found related question in SO. Please have a look.
https://stackoverflow.com/questions/4358732/is-incrementing-a-field-in-mysql-atomic

NO, I can’t be sure.
I don’t know schema, data and your application, but syntactically your query is correct

MasterZiv 2019-11-18 17:12:12
myawesomeusername 2019-11-18 17:10:09
Are you 100% sure that it won’t cause any nasty bugs? I found related question in SO. Please have a look.
https://stackoverflow.com/questions/4358732/is-incrementing-a-field-in-mysql-atomic

Actually, being sure is your task, not mine

myawesomeusername 2019-11-18 17:13:08
I know, it was not my point. I just want to make sure we on the same page.
MasterZiv 2019-11-18 17:13:21
myawesomeusername 2019-11-18 17:10:09
Are you 100% sure that it won’t cause any nasty bugs? I found related question in SO. Please have a look.
https://stackoverflow.com/questions/4358732/is-incrementing-a-field-in-mysql-atomic

I don’t see why it is related to your question.
Only one common thing is both statements are UPDATE.

myawesomeusername 2019-11-18 17:17:52
Let me explain please. I have stock table which holds number of available and sold products. My aim is to allow a customer finish his order only if required amount of products are available currently. To achieve that, I think SELECT FOR UPDATE statement must be used. Because when order made before increasing ‘sold’ counter it has to check remaining stock.
MasterZiv 2019-11-18 17:20:02
myawesomeusername 2019-11-18 17:17:52
Let me explain please. I have stock table which holds number of available and sold products. My aim is to allow a customer finish his order only if required amount of products are available currently. To achieve that, I think SELECT FOR UPDATE statement must be used. Because when order made before increasing ‘sold’ counter it has to check remaining stock.

No, it can be used but not necessarily.

MasterZiv 2019-11-18 17:20:59
myawesomeusername 2019-11-18 17:17:52
Let me explain please. I have stock table which holds number of available and sold products. My aim is to allow a customer finish his order only if required amount of products are available currently. To achieve that, I think SELECT FOR UPDATE statement must be used. Because when order made before increasing ‘sold’ counter it has to check remaining stock.

If you don’t have explicit transaction, SELECT…FOR UPDATE is useless.

Do you have explicit multistatement transaction?

myawesomeusername 2019-11-18 17:22:14
No. It is just one line, it should return whether sold operation status – successful or failure.
MasterZiv 2019-11-18 17:22:45
myawesomeusername 2019-11-18 17:22:14
No. It is just one line, it should return whether sold operation status – successful or failure.

then select for update is completely useless.

MasterZiv 2019-11-18 17:23:54
myawesomeusername 2019-11-18 17:22:14
No. It is just one line, it should return whether sold operation status – successful or failure.

SELECT … FOR UPDATE is used in user-defined multistatement transactions. Otherwise it is same as just one redundant SELECT

myawesomeusername 2019-11-18 17:25:56
Thank you for your explanation sir.
smlkw 2019-11-18 18:12:35
Sir )
MasterZiv 2019-11-18 18:29:46
smlkw 2019-11-18 18:12:35
Sir )

Я сир! (только теперь это плохо)

piterden 2019-11-18 18:43:13
Honestly, I don’t like such of a way of calling me. Despite of it has a good meaning for English speaking persons, for me it seems like a licking and I don’t think that Indians have to call Englishmen with that word.
iDoNotHaveAName 2019-11-18 19:19:29
Hi, may I ask you something?
iDoNotHaveAName 2019-11-18 19:22:23
I have a table like that
ID primary key auto_increment
ID_parent (a FK towards ID)
String Varchar (…)

The user inserts ID_Parent and String, so ID is incremented by +1.
I’d like to retrieve that ID just inserted, but I don’t know how since it is a shared DBMS over network, it means it has concurrent processes and the last ID may have been updated by somebody else

MasterZiv 2019-11-18 23:21:09
iDoNotHaveAName 2019-11-18 19:22:23
I have a table like that
ID primary key auto_increment
ID_parent (a FK towards ID)
String Varchar (…)

The user inserts ID_Parent and String, so ID is incremented by +1.
I’d like to retrieve that ID just inserted, but I don’t know how since it is a shared DBMS over network, it means it has concurrent processes and the last ID may have been updated by somebody else

When do you need to do this?

MasterZiv 2019-11-18 23:22:51
iDoNotHaveAName 2019-11-18 19:22:23
I have a table like that
ID primary key auto_increment
ID_parent (a FK towards ID)
String Varchar (…)

The user inserts ID_Parent and String, so ID is incremented by +1.
I’d like to retrieve that ID just inserted, but I don’t know how since it is a shared DBMS over network, it means it has concurrent processes and the last ID may have been updated by somebody else

Are you looking for this ?
https://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id

iDoNotHaveAName 2019-11-18 23:38:16
MasterZiv 2019-11-18 23:22:51
Are you looking for this ?
https://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id

Yup, thank you

bhupesh patil 2019-11-19 11:43:27
 Hi All, i have Maria Db 10.3 on Linux server and there is requirement to change host name, is there any changes need to be done at Maria Db side after server name changed ?
MasterZiv 2019-11-19 12:40:50
bhupesh patil 2019-11-19 11:43:27
 Hi All, i have Maria Db 10.3 on Linux server and there is requirement to change host name, is there any changes need to be done at Maria Db side after server name changed ?

I don’t think any changes are required, a host can have many names and the DB should not rely on this.

You can actually leave the old name for a while

bhupesh patil 2019-11-19 12:42:07
MasterZiv 2019-11-19 12:40:50
I don’t think any changes are required, a host can have many names and the DB should not rely on this.

You can actually leave the old name for a while

Thanks for the info 🙂

Master Yoda 2019-11-20 11:33:13
I have a question. If I have a galera or master-slave setup and if I want to creare index but not let it logged in binary log, so Can I use set SQL_log_bin=0 so that the index creation query (alter or create index) is not sent to the slaves?
pironmind 2019-11-22 16:02:20
Heve you example how to do this
`
db1 {id, ..} , db2 {id [fkey db1.id], hash, …} => res{id, hash, …}
2019-11-24 08:17:26
Hi friends
2019-11-24 08:18:20
I am interested to learn mysql anyone can help me
smlkw 2019-11-24 19:55:06
Provide more information about your problem. Screenshots, for example.
piterden 2019-11-25 07:16:50
Maybe you have a read-only connection? ))
piterden 2019-11-25 07:19:06
You were right @MasterZiv professor, DBeaver is fixen awesome.
piterden 2019-11-25 07:20:27
After pgadmin the difference is palpable
piterden 2019-11-25 07:20:56
PGAdmin3*
piterden 2019-11-25 07:24:35
Take a look at this system, what do you think about, guys?
piterden 2019-11-25 07:25:32
It’s like a gunplay ))
piterden 2019-11-25 07:26:36
Double relations it seems like DNA
piterden 2019-11-25 07:27:59
Looks like somebody is going to fishing
piterden 2019-11-25 07:28:52
Yes I don’t flood here
piterden 2019-11-25 07:32:12
mysql_en-662.jpg
How could it be happened I spend more days in a group than the creator??? Hm…
|