Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

How to connect to a local MySQL server on my own system as a user other than root through command prompt


  • Please log in to reply
5 replies to this topic

#1 chromebuster

chromebuster

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:08:58 AM

Posted 27 June 2010 - 06:44 PM

Hi folks,
I just have a quick question. I'm running some tests on certain ASP.net applications to see if they can run in certain environments, especially to see if they can run successfully on Aprelium's Abyss Web server in a local environment despite the fact that directions are mostly for IIS and Apache. The problem I'm having is that the MySql server will only allow me to connect as root. I have since created other users per different instructions, mostly for Mojo Portal purposes right now, so, how can I connect as one of those other users from the command line client? Is there something else I should be doing? another program I should be using? In fact, whenever I open MySQL command line client, I am only asked for a password and none of the other information such as user is needed. Why is this? If someone could be so kind as to explain a bit, that would be more than awesome.

Many thanks,
Chromebuster

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge


BC AdBot (Login to Remove)

 


#2 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:07:58 AM

Posted 27 June 2010 - 10:28 PM

how can I connect as one of those other users from the command line client?


mysql -u username -p

OR

mysql --user=username --password=password

where username is username and password is password (duh!). The first command asks you for the password. If you do not specify -p, it means you want o logon without any password.

Edited by Romeo29, 27 June 2010 - 10:36 PM.


#3 chromebuster

chromebuster
  • Topic Starter

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:08:58 AM

Posted 28 June 2010 - 12:42 AM

That's odd. I get error 1064 when I do that. But I tried to connect when the client opened as the other user, but it is simply showing me the starred out field as if it still wants me to connect as root. So I connected as root using the password provided in the installation, and then when trying to use the syntax you just described, that is when I got the error. How can I configure it to prompt me for which user I want to connect as? I suppose that is my real question, and i maybe didn't make that clear enough in my first post. so to make it clearer, basically what happens, is that it doesn't accept any of the parameters for user name or host (which I don't think I have to worry about right now since client and server are running off of the same computer at the moment). Should i try reconfiguring the instance and seeing if then I can get it to work like that? But thanks so much for your help!

Chromebuster

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge


#4 Romeo29

Romeo29

    Learning To Bleep


  • Members
  • 3,194 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:127.0.0.1
  • Local time:07:58 AM

Posted 28 June 2010 - 09:17 AM

MySQL Error 1064 is SQL query syntax error. It can only be shown if you are already logged in.

#5 chromebuster

chromebuster
  • Topic Starter

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:08:58 AM

Posted 28 June 2010 - 05:29 PM

Hi,
I tried logging in as the user other than root, and as expected, I was thrown out of the command line. I'll try to reconfigure the instance and then I'll fiddle with it until I can get the results I'm looking for. Let me know if there's anything I missed. Thanks.

Chromebuster

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge


#6 chromebuster

chromebuster
  • Topic Starter

  • Members
  • 899 posts
  • OFFLINE
  •  
  • Gender:Female
  • Location:the crazy city of Boston, In the North East reaches of New England
  • Local time:08:58 AM

Posted 29 June 2010 - 06:07 PM

Oh ... never mind. Wow! I can't believe this. Apparently I got confused between the term command line and command prompt. It works great when connecting from the run dialog first and then I get the command prompt for the other users created. But thanks so much for your help, and I'm sorry it was so obvious!

Chromebuster

The AccessCop Network is just me and my crew. 

Some call me The Queen of Cambridge





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users