Hallo zusammen,
ich hab eigentlich alles installiert was ich für die Arbeit mit MySql
benötige, leider will es aber nicht funktionieren. Sobald ich mich z.B.
mit dem KDE-Menüpunkt (halt MySql in KDE) MySqlCC eine Datenbank anmelden
will bekomme ich die Fehlermeldung (Unkown MySql Server Host ‘linux’). Das
bedeutet wohl das mein Computer nicht am Server angemeldet ist.
Also wechsel ich zu Root in ./etc/init.d (unter einem Benutzer geht
es nicht keine Berechtigung) und gebe “mysql start” ein.
Meldung: starting Service MySql
Ich wechsle wieder zu meinem Benutzer ins Fenster von MysqlCC und versuche
erneut den Connect wie oben beschrieben mit dem selben ergebniss.
Hier mal meine Fragen:
Ich denke ich muss ne Menge mehr machen als den Server zu starten, aber
WAS?
Gibt es vernüftige Bücher über MySql für Anfänger in MySql die gedruckt
und in Deutsch sind? Ich hab unter dev.mysql.com ein Klasse Buch gefunden
das aber nur Online zur Verfügung steht. Leider!
Kann ich mit/unter Mysql eine Relationale Datenbank auch Programmieren?
Also mehr als Verknüpfungen, Formulare und Berichte erstellen. Also
Berechnungen mit Globalen und Localen Variablen in Bezug auf die
beinhalteten Felder der Datenbank usw.
Hilfe wäre Nett, Tips auch.
Viel Spass noch mit eurem Linuxsystem.
Wünscht Karl-Heinz
Hallo Karl-Heinz
als Buch empfiehlt sich z.B. Micahel Kofler – MySQL.
http://www.linux-magazin.de/Artikel/ausgabe/2001/09/buch/buch.html
Weitere Hinweise (s.a. Administration) und Bücher auch unter
http://de.wikipedia.org/wiki/MySQL
Viel Spaß beim Lesen und Lernen
hmh
Hallo Karl-Heinz,
Noch ein kleiner Hinweis.
Wenn du den Datenbank- Server gestartet hast, so verusche den Datenbank connect nicht auf den Host linux durchzuführen.
Versuche es als erstes mal mit localhost als connection Host.
Als Benutzer kannst du dann root und Passwort nichts eingeben. Dann sollte die connection schon mal klappen.
Gruss
Simon
In dem Buch von Michael Kofler steht eigentlich alles, auch fuer andere Distributionen. Einige Distributionen starten mysql unterschiedlich. mysql start, mysqld start, rcmysql …. Fuer Suse 9.3 auf dem localen Rechner (hier wird ueber einen Socket gegangen, nicht ueber IP, das muss man auch bei Apache beachten).
1 MySQL Intro
1.1 First Start of MySQL
First start with MySQL you will have mostly trouble with the syntax of orders although you know how it should work. Very good is the chapter 3 of the MySQL documentation of the distribution.
First read the doc files of your Linux distribution. I searched long till I found a readme file in one of the folders (where are the SUSE docs for more distributions) of my SUSE/NOVELL Linux 9.3. There I had to start as root a special script before first run of mysql was possible after full installation.
As root you only type “rcmysql start” after the prompt in the terminal session to start the database on your computer.
First steps are easy practised in the mysql terminal session. You launch it only by typing “mysql” in the terminal. So easy it is only if you are only running one computer with the database and a single user. If somebody before you worked with the database then some administrated users are created with closed surroundings and more parameters are necessary. Your administrator then should give you a database only for you for practicing with
“grant all on testDBname_foryou to user1@localhost”
The full command for launching may be then
“mysql -h hostname -u username -p name_of_database”.
Option “-p” means password that will be asked after you have typed in all and pressed return, so illogical you have here the name of the database after the option “-p”.
With “quit” you quit database console input. But the database is further active. You shut down the database you have to use the command “rcmysql stop” (as root). Sometimes you have to add some options in a network. Administrator could have added extensions that you cannot shutdown databases only by simple typing one wrong word.
1.2 First Terminal Session work with MySQL
You should open the mysql database terminal as user in a user terminal and as root in a root terminal to look at the differences. Your database should be nearly empty but some information is possible to pull out. Try following orders:
select version()
select version();
select version(); current_date();
select version(), current_date();
select version(), select current_date();
That should give you a feeling for the syntax. 3rd does not work, and 5 may be not too. You can type SQL commands in capital (that is the default) letters too. If you call functions, variables, parameters and procedures then you have to take care about capital letters. There are some differences between different relational databases.
Orders you should try:
select version()
Displays version of mysql database
select current_date()
Displays/prints current date
select sin(pi()/4)
Demonstrates that you can do some calculations on command level
select now()
prints current date and time
select user()
prints user
show databases
displays available databases
show variables like `have%`
prints all available modes and add ons
show variables `version`
prints same as select version()
show variables `%`
a list of all variables and their values
show status
displays a lot of information.
status
displays a lot of information.
In the table above all these orders don’t change anything in your database.