Jump to content

How To Connect With Command Line?


mabaomsi

Recommended Posts

Hi!

I have a big problem. I want to change the max_user_connection variable on my Mysql server, but soon with the connection i have problem.

I use MySQL Command Line 5.7 to change this value. With this codes:

mysql> -h mabaomsi.heliohost.org -u 'my user name' -p 'my password' maba_jpo

THEN WITH THIS FORM:

mysql> -u 'my user name' -p 'my password' -h mabaomsi.heliohost.org maba_jpo

But the Command Line have a syntax problem with this codes:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'-u 'my user name' -p 'my password' -h mabaomsi.heliohost.org maba_jpo' at line 1

Can someone help me?

Thanks!

Edited by mabaomsi
Link to comment
Share on other sites

We don't allow the max_user_connections value to be changed.

 

If you're opening enough connections to need to increase it, your code is probably poorly written anyway. Usually exceeding the connection limit is because the code not closing its connections when its done using them.

 

As for connecting with the command line tools, you need to pass those arguments on the command line, not inside the mysql program. Exit mysql, then run mysql -u <user> -p <password> -h <host> from your terminal.

Link to comment
Share on other sites

Hi! But why?

I really need it, i have / maked an WinForm applikation, who users can see the components from a simulation game (OMSI2), and the value 1 for max_conn. is nothing, min 10-30 poeople will used my app (i hope) in the same time from one/this database. And this wanna bee really shit, when the another 9-29 users cant connect, becuse one is now seen the database... You understand me? I really need to change it :(

I my app, will all connections closed, when the command is runned sucesfully (f.e: SELECT * FROM blabla WHERE blabblabla = blabblabla)

Can you help me, can we solved my problem?

 

Thanks all!

Link to comment
Share on other sites

Well designed code doesn't need that many mysql connections. If each connection is open for a few milliseconds and then immediately closed it's highly unlikely that you would ever see that error. We have plenty of well designed sites that use our hosting that have thousands of visitors per hour and don't complain about that error. There is really no good reason to use persistent connections in this situation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...