Partyflock
 
Forumonderwerp · 771458
Waarschuw beheerder
Hallo allemaal! :)

Ik ben MySQL nodig, voor een PHP script.
MySQL, PHP 4.1, en Apache2, zijn geinstalleerd.

Allemaal geen probleem mee gehad.

Maar kan het maar niet voorelkaar krijgen, om een database (DB) aan te maken. :S

En wanneer ik denk dat alles goed is, dan kan ie niet connecten... :/

Ik heb hier verschijndene manuals enzo, maar kom dr maar niet uit. Word er echt moedeloos van....

Heeft dr al eens eerder iemand met dit bijltje gehakt? :P
 
Waarschuw beheerder
Waarop heb je alles geinstalleerd? Windows / Linux / Mac ?

1) Weet je zeker dat de service (windows) draait van MySQL?
2) Op welke manier probeer je een db aan te maken. Wat misschien het makkelijkst is, is om bijvoorbeeld phpMyAmdin op je server te zetten (www.phpmyadmin.net) en vanuit daar databases (en users met rechten) aan te maken.
Artiest {SHOWLIST artist 45822, 30830}
Waarschuw beheerder
donateur
linux?

# MYSQL

groupadd mysql

useradd -g mysql mysql



tar zxvf mysql-versie-os.tar.gz

mv mysql-versie-os /usr/local/mysql



cd /usr/local/mysql

./scripts/mysql_install_db



chown -R root /usr/local/mysql

chown -R root /usr/local/mysql/bin

chown -R mysql /usr/local/mysql/data



chgrp -R mysql /usr/local/mysql



./bin/safe_mysqld --user=mysql &

./bin/mysqladmin -u root password 'het wachtwoord hier'


mijn rijtje commando's om het werkend te krijgen. een aantal commando's zijn niet overbodig geworden tegenwoordig aangezien t pakket nu vaak kant en klaar word afgeleverd hehe.


Om met mysql te werken zou ik phpMyAdmin gebruiken. Daarmee kun je via je browser je hele database configureren :) scheelt hoop typ werk ;)
Waarschuw beheerder
linux?


:jaja:
Uhm, wat zou dat anders moeten zijn dan? :P


Maar ik heb sql al geinstalleerd...
Het zit nl gewoon in het pakket. ;)

Maar zoals ik jou nou begrijp Gekkenhuis:
1 Moet ik een group mysql maken.
2 user aanmaken in die group
3 script mysql_install_db opstarten
4 permissie rechten goed zetten...
5 de laatste 2 commando's.

En dan met phpMyAdmin aan de slag?
Maar ik heb ook een graphical admin tool....
Waarschuw beheerder
donateur
jep, zo werkt t bijmij tot nu toe altijd. die andere admin tool kun je natuurlijk ook gebruiken :)
Waarschuw beheerder
Installeer m gewoon via je package management tool, heb je de minste last.

Ik denk overigens dat het handiger is als je ons vertelt wat de foutmelding is.

Uhm, wat zou dat anders moeten zijn dan?


Hoeveel opties wil je horen? :P
laatste aanpassing
 
Waarschuw beheerder
Bij het compilen van php moet je ook de optie "--with-mysql" etc opgeven he.. Anders gewoon ff googlen op "installatie lamp server", zijn zat tutorials over.
Waarschuw beheerder
Hmmm, ik krijg de MySQL server niet opgestart....

Ik heb nu een group mysql, met daarin een user mysql.
Script mysql_install_db heb ik laten draaien.
Maar dan knalt ie met mysqladmin -u root password {PW]
eruit, omdat ie geen mysql.sock kan vinden.
En dat ik moet checken of de server wel draait.

Ik checken, met runleveledit...
ok, draaide dus niet. :$
Ik start m op met 'rcmysql start'.
Krijg een error: failed.

Nou ja, zo draai ik dus al steeds rondjes... :S

Maar ik zal ALLE info maar geven:
mysqlcheck:
mysqlcheck Ver 2.4.3 Distrib 4.0.21, for suse-linux (i686)
By Jani Tolonen, 2001-04-20, MySQL Development Team

This software comes with ABSOLUTELY NO WARRANTY. This is free software,

and you are welcome to modify and redistribute it under the GPL license.

This program can be used to CHECK (-c,-m,-C), REPAIR (-r), ANALYZE (-a)
or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be
used at the same time. It works on MyISAM and in some cases on BDB tables.
Please consult the MySQL manual for latest information about the
above. The options -c,-r,-a and -o are exclusive to each other, which
means that the last option will be used, if several was specified.

The option -c will be used by default, if none was specified. You
can change the default behavior by making a symbolic link, or
copying this file somewhere with another name, the alternatives are:
mysqlrepair: The default option will be -r
mysqlanalyze: The default option will be -a
mysqloptimize: The default option will be -o

Usage: mysqlcheck [OPTIONS] database [tables]
OR mysqlcheck [OPTIONS] --databases DB1 [DB2 DB3...]
OR mysqlcheck [OPTIONS] --all-databases

Default options are read from the following files in the given order:
/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf
The following groups are read: mysqlcheck client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit
--no-defaults Don't read default options from any options file
--defaults-file=# Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read
-A, --all-databases Check all the databases. This will be same as
--databases with all databases selected.
-a, --analyze Analyze given tables.
-1, --all-in-1 Instead of issuing one query for each table, use one
query per database, naming all tables in the database in
a comma-separated list.
--auto-repair If a checked table is corrupted, automatically fix it.
Repairing will be done after all tables have been
checked, if corrupted ones were found.
--character-sets-dir=name
Directory where character sets are
-c, --check Check table for errors
-C, --check-only-changed
Check only tables that have changed since last check or
haven't been closed properly.
--compress Use compression in server/client protocol.
-B, --databases To check several databases. Note the difference in usage;
In this case no tables are given. All name arguments are
regarded as databasenames.
-#, --debug[=name] Output debug log. Often this is 'd:t:o,filename'
--default-character-set=name
Set the default character set
-F, --fast Check only tables that haven't been closed properly
-f, --force Continue even if we get an sql-error.
-e, --extended If you are using this option with CHECK TABLE, it will
ensure that the table is 100 percent consistent, but will
take a long time. If you are using this option with
REPAIR TABLE, it will force using old slow repair with
keycache method, instead of much faster repair by
sorting.
-?, --help Display this help message and exit.
-h, --host=name Connect to host.
-m, --medium-check Faster than extended-check, but only finds 99.99 percent
of all errors. Should be good enough for most cases.
-o, --optimize Optimize table.
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's solicited on the tty.
-P, --port=# Port number to use for connection.
-q, --quick If you are using this option with CHECK TABLE, it
prevents the check from scanning the rows to check for
wrong links. This is the fastest check. If you are using
this option with REPAIR TABLE, it will try to repair only
the index tree. This is the fastest repair method for a
table.
-r, --repair Can fix almost anything except unique keys that aren't
unique.
-s, --silent Print only error messages.
-S, --socket=name Socket file to use for connection.
--tables Overrides option --databases (-B).
-u, --user=name User for login if not current user.
--use-frm When used with REPAIR, get table structure from .frm
file, so the table can be repaired even if .MYI header is
corrupted.
-v, --verbose Print info about the various stages.
-V, --version Output version information and exit.

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
all-databases FALSE
all-in-1 FALSE
auto-repair FALSE
character-sets-dir (No default value)
compress FALSE
databases FALSE
default-character-set (No default value)
fast FALSE
force FALSE
extended FALSE
host (No default value)
port 0
quick FALSE
silent FALSE
socket (No default value)
user (No default value)
use-frm FALSE
-------------------------
/etc/my.cnf:
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /var/lib/mysql) or
# ~/.my.cnf to set user-specific options.
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.

# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock

# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
myisam_sort_buffer_size = 8M

# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
# log-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id = 2
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin

# Point the following paths to different dedicated disks
#tmpdir = /tmp/
#log-update = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /var/lib/mysql/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /var/lib/mysql/
#innodb_log_arch_dir = /var/lib/mysql/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

# The safe_mysqld script
[safe_mysqld]
err-log=/var/lib/mysql/mysqld.log

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
-----------------------
En nog ff wat anders:
Ik kan geen dir /usr/local/mysql vinden. Wat ik zo aan mysql zie staan, staat onder /usr/bin.
En waar de data files staan, ben ik nog niet achter....

En het maakt me verder ff niet uit wat voor namen er gebruikt worden ed.
Als ik erst de boel maar draaiend heb, en het snap allemaal, dan kan ik dan, de uiteindelijke opzet maken.

Maar laten we ff voor de makkelijkheid :P, ff de volgende gegevens nemen...:

Host: marjon
db_name: marjon_db
user: mysql
user_pw: sqldommie
port: 3306

Enne tussen haakjes: de files in de dir's: /bin, /sbin /usr/bin en /usr/sbin hebben allemaal al uid ROOT.

Maar als ik dit zo alles terug lees, lijkt het er wel op, dat ik al die variables, van mysqladmin, nog moet zetten, ofzo...
Of dat ik eerst nog die cnf file doormoet....
laatste aanpassing
Waarschuw beheerder
Heb die reference guide ook ff opgehaald, maar word er niet veel wijzer van.... :S
Waarschuw beheerder
Nou, hehe, jippie!!!! :bounce:


Hij draait hoor!!!!


:bounce: :bounce:

Dit moest ik doen:
mkdir /home/mysql
mv /var/lib/mysql/* /home/mysql/
rmdir /var/lib/mysql
ln -s /home/mysql /var/lib/mysql
chown -R mysql:mysql /home/mysql
start mysql server

En ja hoor doet ie!!
hopen dat het nou verder goed gaat dan...
Waarschuw beheerder
Hmmm, heb de server nu wel draaiend, maar kan niet connecten??? :@

Krijg dr een punthoofd van! :P
Waarschuw beheerder
Dit is nu wat ik krijg met mysql, (zonder de rits opties)...

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
auto-rehash FALSE
character-sets-dir (No default value)
default-character-set (No default value)
compress FALSE
database (No default value)
vertical FALSE
force FALSE
named-commands FALSE
local-infile FALSE
no-beep FALSE
host (No default value)
html FALSE
xml FALSE
line-numbers TRUE
unbuffered FALSE
column-names TRUE
port 3306
prompt mysql>
quick FALSE
raw FALSE
socket /var/lib/mysql/mysql.sock
table FALSE
debug-info FALSE
user (No default value)
safe-updates FALSE
i-am-a-dummy FALSE
connect_timeout 0
max_allowed_packet 16777216
net_buffer_length 16384
select_limit 1000
max_join_size 1000000


En dit geeft nu mysqladmin:
mysqladmin Ver 8.40 Distrib 4.0.21, for suse-linux on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Administration program for the mysqld daemon.
Usage: mysqladmin [OPTIONS] command command....
-c, --count=# Number of iterations to make. This works with -i
(--sleep) only
-#, --debug[=name] Output debug log. Often this is 'd:t:o,filename'
-f, --force Don't ask for confirmation on drop database; with
multiple commands, continue even if an error occurs.
-C, --compress Use compression in server/client protocol
--character-sets-dir=name
Directory where character sets are.
-?, --help Display this help and exit.
-h, --host=name Connect to host
-p, --password[=name]
Password to use when connecting to server. If password is
not given it's asked from the tty.
-P, --port=# Port number to use for connection.
-r, --relative Show difference between current and previous values when
used with -i. Currently works only with extended-status.
-O, --set-variable=name
Change the value of a variable. Please note that this
option is deprecated; you can set variables directly with
--variable-name=value.
-s, --silent Silently exit if one can't connect to server
-S, --socket=name Socket file to use for connection.
-i, --sleep=# Execute commands again and again with a sleep between.
-u, --user=name User for login if not current user.
-v, --verbose Write more information.
-V, --version Output version information and exit
-E, --vertical Print output vertically. Is similar to --relative, but
prints output vertically.
-w, --wait[=#] Wait and retry if connection is down
--connect_timeout=#
--shutdown_timeout=#

Variables (--variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
--------------------------------- -----------------------------
count 0
force FALSE
compress FALSE
character-sets-dir (No default value)
host (No default value)
port 3306
relative FALSE
socket /var/lib/mysql/mysql.sock
sleep 0
user (No default value)
verbose FALSE
vertical FALSE
connect_timeout 43200
shutdown_timeout 3600

Default options are read from the following files in the given order:
/etc/my.cnf /var/lib/mysql/my.cnf ~/.my.cnf
The following groups are read: mysqladmin client
The following options may be given as the first argument:
--print-defaults Print the program argument list and exit
--no-defaults Don't read default options from any options file
--defaults-file=# Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read

Where command is a one or more of: (Commands may be shortened)
create databasename Create a new database
drop databasename Delete a database and all its tables
extended-status Gives an extended status message from the server
flush-hosts Flush all cached hosts
flush-logs Flush all logs
flush-status Clear status variables
flush-tables Flush all tables
flush-threads Flush the thread cache
flush-privileges Reload grant tables (same as reload)
kill id,id,... Kill mysql threads
password new-password Change old password to new-password
ping Check if mysqld is alive
processlist Show list of active threads in server
reload Reload grant tables
refresh Flush all tables and close and open logfiles
shutdown Take server down
status Gives a short status message from the server
start-slave Start slave
stop-slave Stop slave
variables Prints variables available
version Get version info from server
laatste aanpassing
Waarschuw beheerder
en wanneer ik een 'mysqladmin ping' doe, zegt ie dat ie:

mysqladmin: connect to server at 'localhost' failed.
error: acces denied for user: 'root@localhost' (using password: YES)

Ben nu dus af, vd error, dat ie geen mysql.sock kan vinden, maar daar heb ik nu dus deze voor terug. :S

Tussen kaakjes...
Heeft iemand hier een ENORME puntenslijper??? :P
laatste aanpassing
Waarschuw beheerder
Heeft iemand hier een ENORME puntenslijper??? :P


Helaas alleen in zak formaat. :9
laatste aanpassing
Waarschuw beheerder
donateur
krijg je der zo'n punthoofd van dan? :9

heb je de root wel een password gegeven?
Waarschuw beheerder
Uhm ja, das waar ook, dat had ik al geprobeerd. :)
Daar krijg ik steeds deze error op:

mysqladmin: connect to server at 'localhost' failed.
error: acces denied for user: 'root@localhost' (using password: YES)
 
Waarschuw beheerder
donateur
Uitspraak van Miss_Marjon; Stuffy; op maandag 2 mei 2005 om 11:11:
mysqladmin: connect to server at 'localhost' failed.
error: acces denied for user: 'root@localhost' (using password: YES)


standaard heeft root geen password, tenzij je het hebt ingesteld.
Waarschuw beheerder
donateur
hmmm ik gebruik t altijd wel :|
maar als t idd niet nodig is ga ik es ff kijke of k dat eruit kan halen
Waarschuw beheerder
Als je dat dan ff doorgeeft zou fijn zijn.

Maar ik wil toch ook nog debian installen, eens ff kijken of het daar beter gaat.
Waarschuw beheerder
donateur
ah het commando niet uitvoeren van "./bin/mysqladmin -u root password 'het wachtwoord hier'" ;) opgelost hehe.

heb je phpmyadmin al geprobeerd???
Waarschuw beheerder
Ik had het spul onder windows zo draaien... :P
Waarschuw beheerder
Kan best!

Maar onder Windows eb je het ook 2 keer zo snel gekraakt! (y)


Beetje late reactie, btw... :/
laatste aanpassing
Waarschuw beheerder
Volg deze tutorial dan maar eens, misschien heb je er iets aan.

TUTOR..
Waarschuw beheerder
Uhm, ik weet niet of je het id gaten hebt, maar deze topic is zo ondertussen alweer een maand oud!

Heb het probleem, allaaaaaang opgelost! :P


:D:D:D