Mainos / Advertisement:
Vie käännöksiä
Siirry navigaatioon
Siirry hakuun
Asetukset
Ryhmä
Active Directory Domain Services
Amavis
Apache2
APT
Automysqlbackup
Backup
Bashrc
Bind9
Cachet
Cellmapper
Cellmapper/Changelog
Cellmapper/FAQ
Chmod
Cisco Catalyst C2620 reititin
Cisco Catalyst C2950T-24 kytkin
Cisco IOS peruskäyttö
Cisco Router NAT/PAT
Crontab
DDNS päivitysohjelmat
Debian
Debian verkkokonfiguraatio
Debian WLAN
DHCP Server
DNS Server
Dovecot
Drupal
Etusivu
Fail2ban
File Server Resource Manager
Fstab
Gnome
Grep
Group Policy Management
Hyper-V
Inteno DG301AL
IPsec
Iptables
Irssi
Isc-dhcp-relay
Isc-dhcp-server
Isäntänimen muuttaminen
Kali Linux
Kuuluvuuskartat
Linux AD liitos
Lm-sensors
Midnight Commander
Mobiiliverkkotekniikka
Mysql
Nano
Network Policy and Access Services
Nginx
Novell NetWare
Observium
Openssl
Openvpn
Owncloud
Php5
Phpmyadmin
Port-security
Postfix
PowerShell
Pptp-linux
PPTP-serveri
Proxmox
Qemu-kvm
Roundcube
RouterOS
RouterOS bridge
RouterOS CAPsMAN
RouterOS DHCP
RouterOS Firewall
RouterOS IPTV
RouterOS IPv6
RouterOS LTE
RouterOS NAT
RouterOS OpenVPN
RouterOS Route
RouterOS VLAN
RouterOS VPN
RouterOS WLAN
RWEverything
Samba
Serial port yhteys
Server Core
Spamassassin
Squid
Ssh
Sstp-client
Staattinen IP
Sysprep
Taisto:Tietoja
Taisto:Tietosuojakäytäntö
Teamspeak3
Telia IPTV asetukset
Ubuntu Server
USB-Asennus
Verkkokaapelointi
Vesta
Vi
Vnstat
Vsftpd
VTP
Wds&dhcpd
WDS+ADK
Web Server (IIS)
Windows 8.1
Windows Deployment Services
Windows komentoja
Windows Server 2012 R2
WLAN
Wordpress
ZTE MF823D
Kieli
aa - Qafár af
ab - Аҧсшәа
abs - bahasa ambon
ace - Acèh
ady - адыгабзэ
ady-cyrl - адыгабзэ
aeb - تونسي/Tûnsî
aeb-arab - تونسي
aeb-latn - Tûnsî
af - Afrikaans
ak - Akan
aln - Gegë
am - አማርኛ
an - aragonés
ang - Ænglisc
anp - अङ्गिका
ar - العربية
arc - ܐܪܡܝܐ
arn - mapudungun
arq - جازايرية
ary - Maġribi
arz - مصرى
as - অসমীয়া
ase - American sign language
ast - asturianu
atj - Atikamekw
av - авар
avk - Kotava
awa - अवधी
ay - Aymar aru
az - azərbaycanca
azb - تۆرکجه
ba - башҡортса
ban - Basa Bali
bar - Boarisch
bbc - Batak Toba
bbc-latn - Batak Toba
bcc - جهلسری بلوچی
bcl - Bikol Central
be - беларуская
be-tarask - беларуская (тарашкевіца)
bg - български
bgn - روچ کپتین بلوچی
bh - भोजपुरी
bho - भोजपुरी
bi - Bislama
bjn - Bahasa Banjar
bm - bamanankan
bn - বাংলা
bo - བོད་ཡིག
bpy - বিষ্ণুপ্রিয়া মণিপুরী
bqi - بختیاری
br - brezhoneg
brh - Bráhuí
bs - bosanski
btm - Batak Mandailing
bto - Iriga Bicolano
bug - ᨅᨔ ᨕᨘᨁᨗ
bxr - буряад
ca - català
cbk-zam - Chavacano de Zamboanga
cdo - Mìng-dĕ̤ng-ngṳ̄
ce - нохчийн
ceb - Cebuano
ch - Chamoru
cho - Choctaw
chr - ᏣᎳᎩ
chy - Tsetsêhestâhese
ckb - کوردی
co - corsu
cps - Capiceño
cr - Nēhiyawēwin / ᓀᐦᐃᔭᐍᐏᐣ
crh - qırımtatarca
crh-cyrl - къырымтатарджа (Кирилл)
crh-latn - qırımtatarca (Latin)
cs - čeština
csb - kaszëbsczi
cu - словѣньскъ / ⰔⰎⰑⰂⰡⰐⰠⰔⰍⰟ
cv - Чӑвашла
cy - Cymraeg
da - dansk
de - Deutsch
de-at - Österreichisches Deutsch
de-ch - Schweizer Hochdeutsch
de-formal - Deutsch (Sie-Form)
din - Thuɔŋjäŋ
diq - Zazaki
dsb - dolnoserbski
dtp - Dusun Bundu-liwan
dty - डोटेली
dv - ދިވެހިބަސް
dz - ཇོང་ཁ
ee - eʋegbe
egl - Emiliàn
el - Ελληνικά
eml - emiliàn e rumagnòl
en - English
en-ca - Canadian English
en-gb - British English
eo - Esperanto
es - español
es-419 - español de América Latina
es-formal - español (formal)
et - eesti
eu - euskara
ext - estremeñu
fa - فارسی
ff - Fulfulde
fi - suomi
fit - meänkieli
fj - Na Vosa Vakaviti
fo - føroyskt
fr - français
frc - français cadien
frp - arpetan
frr - Nordfriisk
fur - furlan
fy - Frysk
ga - Gaeilge
gag - Gagauz
gan - 贛語
gan-hans - 赣语(简体)
gan-hant - 贛語(繁體)
gcr - kriyòl gwiyannen
gd - Gàidhlig
gl - galego
glk - گیلکی
gn - Avañe'ẽ
gom - गोंयची कोंकणी / Gõychi Konknni
gom-deva - गोंयची कोंकणी
gom-latn - Gõychi Konknni
gor - Bahasa Hulontalo
got - 𐌲𐌿𐍄𐌹𐍃𐌺
grc - Ἀρχαία ἑλληνικὴ
gsw - Alemannisch
gu - ગુજરાતી
gv - Gaelg
ha - Hausa
hak - 客家語/Hak-kâ-ngî
haw - Hawaiʻi
he - עברית
hi - हिन्दी
hif - Fiji Hindi
hif-latn - Fiji Hindi
hil - Ilonggo
ho - Hiri Motu
hr - hrvatski
hrx - Hunsrik
hsb - hornjoserbsce
ht - Kreyòl ayisyen
hu - magyar
hu-formal - magyar (formal)
hy - հայերեն
hyw - արեւմտահայերէն
hz - Otsiherero
ia - interlingua
id - Bahasa Indonesia
ie - Interlingue
ig - Igbo
ii - ꆇꉙ
ik - Iñupiak
ike-cans - ᐃᓄᒃᑎᑐᑦ
ike-latn - inuktitut
ilo - Ilokano
inh - ГӀалгӀай
io - Ido
is - íslenska
it - italiano
iu - ᐃᓄᒃᑎᑐᑦ/inuktitut
ja - 日本語
jam - Patois
jbo - la .lojban.
jut - jysk
jv - Basa Jawa
ka - ქართული
kaa - Qaraqalpaqsha
kab - Taqbaylit
kbd - Адыгэбзэ
kbd-cyrl - Адыгэбзэ
kbp - Kabɩyɛ
kg - Kongo
khw - کھوار
ki - Gĩkũyũ
kiu - Kırmancki
kj - Kwanyama
kjp - ဖၠုံလိက်
kk - қазақша
kk-arab - قازاقشا (تٴوتە)
kk-cn - قازاقشا (جۇنگو)
kk-cyrl - қазақша (кирил)
kk-kz - қазақша (Қазақстан)
kk-latn - qazaqşa (latın)
kk-tr - qazaqşa (Türkïya)
kl - kalaallisut
km - ភាសាខ្មែរ
kn - ಕನ್ನಡ
ko - 한국어
ko-kp - 조선말
koi - Перем Коми
kr - Kanuri
krc - къарачай-малкъар
kri - Krio
krj - Kinaray-a
krl - karjal
ks - कॉशुर / کٲشُر
ks-arab - کٲشُر
ks-deva - कॉशुर
ksh - Ripoarisch
ku - kurdî
ku-arab - كوردي (عەرەبی)
ku-latn - kurdî (latînî)
kum - къумукъ
kv - коми
kw - kernowek
ky - Кыргызча
la - Latina
lad - Ladino
lb - Lëtzebuergesch
lbe - лакку
lez - лезги
lfn - Lingua Franca Nova
lg - Luganda
li - Limburgs
lij - Ligure
liv - Līvõ kēļ
lki - لەکی
lmo - lumbaart
ln - lingála
lo - ລາວ
loz - Silozi
lrc - لۊری شومالی
lt - lietuvių
ltg - latgaļu
lus - Mizo ţawng
luz - لئری دوٙمینی
lv - latviešu
lzh - 文言
lzz - Lazuri
mai - मैथिली
map-bms - Basa Banyumasan
mdf - мокшень
mg - Malagasy
mh - Ebon
mhr - олык марий
mi - Māori
min - Baso Minangkabau
mk - македонски
ml - മലയാളം
mn - монгол
mni - মেইতেই লোন্
mnw - ဘာသာ မန်
mo - молдовеняскэ
mr - मराठी
mrj - кырык мары
ms - Bahasa Melayu
mt - Malti
mus - Mvskoke
mwl - Mirandés
my - မြန်မာဘာသာ
myv - эрзянь
mzn - مازِرونی
na - Dorerin Naoero
nah - Nāhuatl
nan - Bân-lâm-gú
nap - Napulitano
nb - norsk bokmål
nds - Plattdüütsch
nds-nl - Nedersaksies
ne - नेपाली
new - नेपाल भाषा
ng - Oshiwambo
niu - Niuē
nl - Nederlands
nl-informal - Nederlands (informeel)
nn - norsk nynorsk
no - norsk
nov - Novial
nrm - Nouormand
nso - Sesotho sa Leboa
nv - Diné bizaad
ny - Chi-Chewa
nys - Nyunga
oc - occitan
olo - Livvinkarjala
om - Oromoo
or - ଓଡ଼ିଆ
os - Ирон
pa - ਪੰਜਾਬੀ
pag - Pangasinan
pam - Kapampangan
pap - Papiamentu
pcd - Picard
pdc - Deitsch
pdt - Plautdietsch
pfl - Pälzisch
pi - पालि
pih - Norfuk / Pitkern
pl - polski
pms - Piemontèis
pnb - پنجابی
pnt - Ποντιακά
prg - Prūsiskan
ps - پښتو
pt - português
pt-br - português do Brasil
qu - Runa Simi
qug - Runa shimi
rgn - Rumagnôl
rif - Tarifit
rm - rumantsch
rmy - Romani
rn - Kirundi
ro - română
roa-tara - tarandíne
ru - русский
rue - русиньскый
rup - armãneashti
ruq - Vlăheşte
ruq-cyrl - Влахесте
ruq-latn - Vlăheşte
rw - Kinyarwanda
sa - संस्कृतम्
sah - саха тыла
sat - ᱥᱟᱱᱛᱟᱲᱤ
sc - sardu
scn - sicilianu
sco - Scots
sd - سنڌي
sdc - Sassaresu
sdh - کوردی خوارگ
se - davvisámegiella
sei - Cmique Itom
ses - Koyraboro Senni
sg - Sängö
sgs - žemaitėška
sh - srpskohrvatski / српскохрватски
shi - Tašlḥiyt/ⵜⴰⵛⵍⵃⵉⵜ
shi-latn - Tašlḥiyt
shi-tfng - ⵜⴰⵛⵍⵃⵉⵜ
shn - ၽႃႇသႃႇတႆး
shy-latn - tachawit
si - සිංහල
simple - Simple English
sk - slovenčina
skr - سرائیکی
skr-arab - سرائیکی
sl - slovenščina
sli - Schläsch
sm - Gagana Samoa
sma - Åarjelsaemien
sn - chiShona
so - Soomaaliga
sq - shqip
sr - српски / srpski
sr-ec - српски (ћирилица)
sr-el - srpski (latinica)
srn - Sranantongo
ss - SiSwati
st - Sesotho
stq - Seeltersk
sty - cебертатар
su - Basa Sunda
sv - svenska
sw - Kiswahili
szl - ślůnski
ta - தமிழ்
tay - Tayal
tcy - ತುಳು
te - తెలుగు
tet - tetun
tg - тоҷикӣ
tg-cyrl - тоҷикӣ
tg-latn - tojikī
th - ไทย
ti - ትግርኛ
tk - Türkmençe
tl - Tagalog
tly - толышә зывон
tn - Setswana
to - lea faka-Tonga
tpi - Tok Pisin
tr - Türkçe
tru - Ṫuroyo
ts - Xitsonga
tt - татарча/tatarça
tt-cyrl - татарча
tt-latn - tatarça
tum - chiTumbuka
tw - Twi
ty - reo tahiti
tyv - тыва дыл
tzm - ⵜⴰⵎⴰⵣⵉⵖⵜ
udm - удмурт
ug - ئۇيغۇرچە / Uyghurche
ug-arab - ئۇيغۇرچە
ug-latn - Uyghurche
uk - українська
ur - اردو
uz - oʻzbekcha/ўзбекча
uz-cyrl - ўзбекча
uz-latn - oʻzbekcha
ve - Tshivenda
vec - vèneto
vep - vepsän kel’
vi - Tiếng Việt
vls - West-Vlams
vmf - Mainfränkisch
vo - Volapük
vot - Vaďďa
vro - Võro
wa - walon
war - Winaray
wo - Wolof
wuu - 吴语
xal - хальмг
xh - isiXhosa
xmf - მარგალური
xsy - saisiyat
yi - ייִדיש
yo - Yorùbá
yue - 粵語
za - Vahcuengh
zea - Zeêuws
zgh - ⵜⴰⵎⴰⵣⵉⵖⵜ ⵜⴰⵏⴰⵡⴰⵢⵜ
zh - 中文
zh-cn - 中文(中国大陆)
zh-hans - 中文(简体)
zh-hant - 中文(繁體)
zh-hk - 中文(香港)
zh-mo - 中文(澳門)
zh-my - 中文(马来西亚)
zh-sg - 中文(新加坡)
zh-tw - 中文(台灣)
zu - isiZulu
qqq - Message documentation
Muoto
Vie off-line kääntämiseen soveltuvassa muodossa
Vie perusmuodossa
Hae
{{DISPLAYTITLE:Mysql}}<languages/> Mysql is a handy database which is easy to manage using the [[phpmyadmin]] application. Using [[phpmyadmin]] requires HTTP server software as well for instance [[Apache2]] or [[Nginx]] and [[Php5]]. == Installation == [[aptitude]] install mysql-server Give the mysql root user login password in installation. Do not forget the password. You can create more user accounts and change passwords later. You can also use a mysql database without [[phpmyadmin]] but it helps a lot with managing it. [[aptitude]] install mysql-client <gallery> Tiedosto:Debian mysql installation 1.png|Give password for MySQL server root user Tiedosto:Debian mysql installation 2.png|Repeat root user password </gallery> == MySQL configuration == Configuration file can be found in Ubuntu and Debian under: /etc/mysql/my.cnf The port the MySQL server listens to. By default it is set to 3306. [client] port 3306 Address the server will listen to. Put a # number sign in front of the line and it will listen to all IP addresses. bind-address = 127.0.0.1 == Command Line == Mysql databases can also be managed by command line. You can connect to a mysql server with command line by: mysql -u root -p Give the mysql root user password. === User Accounts === List user accounts: select host, user, password from mysql.user; You can create a new user account with the command: CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password'; Give privileges for the new user account. The following command gives pretty much all privileges except the ones for modifying user accounts. GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost'; This command gives the user all privileges including databases and users accounts. GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'%' WITH GRANT OPTION; Confirm privileges: FLUSH PRIVILEGES; Add certain privileges to a user account: GRANT [type of permission] ON [database name].[table name] TO ‘[username]’@'localhost’; Remove certain privileges from a user account: REVOKE [type of permission] ON [database name].[table name] FROM ‘[username]’@‘localhost’; Remove user account: DROP USER ‘demo’@‘localhost’; == Master and Slave == Asynchronous synchronization of a MySQL server from Master server to Slave servers. === Master === This goes in the Master server's configuration: nano /etc/mysql/my.cnf Add these to the end of mysqld [mysqld] ... log-bin=mysql-bin server-id = 1 auto_increment_increment = 10 auto_increment_offset = 1 Form connection to MySQL server: mysql -u root -p We create the user account replicant, with login rights from wherever % and password is just "password" create user replicant@'%' identified by 'password'; Define privileges for the user: GRANT SELECT, PROCESS, FILE, SUPER, REPLICATION CLIENT, REPLICATION SLAVE, RELOAD ON *.* TO replicant@'%'; Flush Privileges; === Slave === This goes in the Slave server's configuration: Establish a connection to the database server and give the Master server's IP-address, username and password. HANGE MASTER TO MASTER_HOST='10.10.10.100', MASTER_USER='replicant', MASTER_PASSWORD='password'; Start the Slave server Start slave; Make sure that everything works: show slave status\G When synchronizing both ways, you must define the role for both servers, one Slave and one Master. == MYSQL and PHP5 == You can fetch and send information to the MySQL database using PHP. This is simply done by the command: <?php mysqli_connect(host,username,password,dbname); mysqli_close($con); ?> Modify this to for example: <?php //Establishing connection to database $con = mysqli_connect(127.0.0.1,root,Qwerty123,database); //Closing connection to database mysqli_close($con); ?> So basically we select the server address, username, password and the database. Printing from MySQL database: <?php $con=mysqli_connect("127.0.0.1","root","Qwerty123","database"); if (mysqli_connect_errno()) { echo "Connecting failed. " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM data"); while($row = mysqli_fetch_array($result)) { echo $row['mysql']; } mysqli_close($con); ?> Note that the database needs to have something written in it in order for you to print from it. Save the previous configurations into mysql.php and then for instance write the following in the index.php file: <?php include_once ('mysql.php'); ?> You have to write this in every php file that will use the database. == Backup == [[Automysqlbackup]] == Sources == https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql [[Category:Linux]] [[Category:Mysql]] [[Category:PHP5]]
Mainos / Advertisement:
Navigointivalikko
Henkilökohtaiset työkalut
suomi
Kirjaudu sisään
Nimiavaruudet
Toimintosivu
Kirjoitusjärjestelmät
Näkymät
Muut
Haku
Valikko
Etusivu
Ajankohtaista
Tuoreet muutokset
Satunnainen sivu
Ohje
Työkalut
Toimintosivut
Tulostettava versio