Hi, i've never used linux before, so what i have is a really basic question
Basically i've been qiven a linux machine (more specifically Red Hat linux).
This machine has everything installed, i.e. MySQL, apache and PHP.
I already know that apache (httpd) and mysql (mysqld) are running as a service, now what i'm trying to do is to start the MySQL window, i.e. the window that i can type something along the lines of "select * from table1;"
in windows i just get a dos type window to enter the sql queries into, after apache is started.
But in linux, i can't find the console or program that i need to use to get this thing to start.
Aplogies if this is really basic, but i just got given this linux. and have been looking searching all over net for answers.
any help would be of great help
15 4761 prn 254
Expert 100+
I don't claim to be an expert on mysql, but it looks to me like http://www.yolinux.com/TUTORIALS/LinuxTutorialMySQL.html (the first google hit for "linux mysql console") seems to have a useful basic intro for how to do essentially what you are asking. If this does not help, let us know what part doesn't work.
Best Regards,
Paul
Hi prn,
thanks for the reply, though it's not quite what i'm after.
Basically, i'm trying to find the linux console, and more importantly the mysql console.
Let me explain:
the text below is a linux command
$ man -k files
where do i type these commands into, i.e. how do i get to the program/console that allows me to type these commands
for example, in windows, to get to dos I would go to start --> programs --> accessories --> command prompt
to get to the windows console.
also to start the MySQL database, i believe that i need to type:
/etc/rc.d/init.d/mysqld start
but, again, were do i type this into.
I know this may sound like a simple question, maybe i'm not phrasing it properly. but i've looked all over the linux machine for this console or program. the fact that i don't know the name of the actual thing that i'm loooking for makes the whole thing more harder.
I'm assuming (with Red Hat) that you're using KDE. In this case, I believe it is called a "Terminal" or "Console" and looks like a computer monitor/screen. I'm not entirely sure which menu this is in, but if you go to the main menu, I would guess it's in System or something around there.
There's another option as well, but last time I used it, it broke KDE, so I'm not sure I want to recommend that yet (of course, the last time I used it was a few years ago).
You could try and find the run command, it is usually placed nicely in one of the menus.
Some of the different consoles are:
konsole
gnome-terminal
term
xterm
Once you have gotten one of those, the mysql command line can be brought up via 'mysql'
sicarie/Motoma
thanks guys, this was exactly what i was after.
it was called terminal.
and also the 'run program' bit worked as well
but, still trying to get the mysql console to appear, doesn't seem to like the command 'mysql' in the run programs bit.
sicarie/Motoma
thanks guys, this was exactly what i was after.
it was called terminal.
and also the 'run program' bit worked as well
but, still trying to get the mysql console to appear, doesn't seem to like the command 'mysql' in the run programs bit.
Does it give you an error when you try 'mysql'? Which user are you when you are attempting to log in?
(And now that you have console access, did you look at the yolinux tutorial that prn posted?)
sicarie/Motoma
thanks guys, this was exactly what i was after.
it was called terminal.
and also the 'run program' bit worked as well
but, still trying to get the mysql console to appear, doesn't seem to like the command 'mysql' in the run programs bit.
Did you try calling it from inside the terminal?
It should look something like this:
[username@hostname ~]# mysql
(you will only type mysql, the rest is your prompt)
What message do you get?
maybe the path to your mysql is not set. Please check.
If typing mysql in your terminal doesnt work, search for mysql.
Also check if the service is running.
/sbin/service mysqld start -to start mysqld
Did you try calling it from inside the terminal?
It should look something like this:
[username@hostname ~]# mysql
(you will only type mysql, the rest is your prompt)
What message do you get?
when i run 'mysql' through the run program, nothing happens i.e. there are no errors, and nothing else appears on the screen, it just seems to do nothing.
however when i run 'mysql' through the terminal: i get the following error:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
I guessed this had something to do with the password not being set.
therefore, from the link that prn posted, i tried resetting the password using
mysqladmin -u root password xxxxxx
but this brings up an error:
mysqladmin: connect to server at 'localhost' failed
error: Access denied for user: 'root@localhost' (Using password: NO)
but then i tried to create a database anyway, using the line
mysqladmin -h localhost -u root -pxxxxxx create cw
and this gives the error:
mysqladmin: connect to server at 'localhost' failed
error: Access denied for user: 'root@localhost' (Using password: YES)
same as before but this time the Using password is YES rather than NO. i have no idea what this means, but i assume that it means that i've attempted a password
also when i try to connect to the database using:
mysql -h localhost -u root -pxxxxxx
i get:
ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
I'm not sure, but i think its becuase i may be using the wrong password to connect, in which case i will probably have to reinstall MySQL to rest the password.
the mysqld service is definatly running, and also i made sure it was by typing
/sbin/service mysqld start (system reponded my saying starting MySQL)
as suggested by devikacs
What you will want to do is this:
# mysqladmin -u root password xxxxxxxx
# mysql -p
You will then be prompted for your password.
Hi Motoma,
I have tried that,
typing
# mysqladmin -u root password xxxxxxxx
gives me the error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
any idea on the possible cause of this, e.g. whether it is a password problem, a user access/permission problem or just that MySQL is incorrectly setup.
Hi Motoma,
I have tried that,
typing
# mysqladmin -u root password xxxxxxxx
gives me the error:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user: 'root@localhost' (Using password: NO)'
any idea on the possible cause of this, e.g. whether it is a password problem, a user access/permission problem or just that MySQL is incorrectly setup.
Oh, mysqladmin needs the password. Try adding -p to the argument list.
Hi,
thanks for your help guys.
i managed to get into mysql console
the problem was that the user had been changed, and was not the default 'root' user.
in the end, after lots of combinations, the line below got me in.
#mysql -u xxxxxx -pxxxxxx
thanks again to those that replied to this post, in was very helpful
Glad you have gotten everything figured out. Come back anytime you have a problem.
For some reason:
#mysql -u -p
also works;
meaning that i just needed to leave the username and password.empty.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hank |
last post by:
Hi,
does anyone know how to change the foreground color of the command
prompt through python?
For example if i was printing out an error message, I would like it to
be red where the normal...
|
by: Eric Ching |
last post by:
Can I run pythonw with a script that takes command line arguments then
launches a GUI? I try pythonw myscript.pyw -option arg (etc.) and
nothing happens. Nothing, as in I am immediately returned...
|
by: Paul Deverson |
last post by:
I'm a newbie to MySQL and am really confused about when I should be using
the Command Line Client and when the DOS prompt.
I'm using Windows XP and I've just installed MySQL 4.1.10.
I can use...
|
by: Mark A. Nadig |
last post by:
I've got a console application in vb.net to replicate the behavior of
the old DOS command CHOICE. I've got a timer event successfully
firing, however the main thread is stuck on the console.read()....
|
by: emma_middlebrook |
last post by:
Hi
If I'm developing a console application, I'd rather not have to go to
the project settings and edit the command line arguments each time and
then run.
Is there a way I can get a console...
|
by: Peter Nimmo |
last post by:
Hi,
I am writting a windows application that I want to be able to act as if
it where a Console application in certain circumstances, such as error
logging.
Whilst I have nearly got it, it...
|
by: CeciMar |
last post by:
I'm new to vb.net and I have a very simple console application. When I attempt to compile it at the command prompt I get error BC30420 Sub Main not found. I know the namespace and module name but...
|
by: vel |
last post by:
Hi,
My program is access the remote system's command prompt through C# program. I can do it. But problem is alignment of that output.
can any one give idea to align that output ?.
here is...
|
by: Jwe |
last post by:
Hi,
I've written a program which has both a command line interface
and Windows form interface, however it isn't quite working
correctly.
When run from command line with no arguments it should...
|
by: bkamrani |
last post by:
Hi,
This is a basic problem, but I want to print help content in a Command
Prompt in WinXP and scrolling back to see the first lines. If I start
a command prompt and run python, and then for...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |