Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Procedimentos iniciais:
mysql_install_db --user=mysql /usr/bin/mysqladmin -u root password 'SenhaUSRroot' /usr/bin/mysqladmin -u root -h Linux-ASA password 'senhaMaquinaLocal' -p
Crie um usurio:
mysql -p create user 'teobaldo'@'%' IDENTIFIED BY 'sua_senha';
Crie o banco:
create database databasename;
Mostre os bancos:
show databases;
D permisses ao usurio:
grant all privileges on *.* to 'teobaldo'@'%' with grant option;
Selecione o banco:
use databasename;
Crie tabelas:
Exemplo 1:
CREATE TABLE `teste` ( `Nome` varchar(100) DEFAULT NULL, `Idade` int(11) DEFAULT NULL );
Exemplo 2:
CREATE TABLE Tabela2 ( firstname VARCHAR(20), middleinitial VARCHAR(3), lastname VARCHAR(35), suffix VARCHAR(3),
officeid VARCHAR(10), userid VARCHAR(15), username VARCHAR(8), email VARCHAR(35), phone VARCHAR(25), groups VARCHAR(15), datestamp DATE, timestamp time, pgpemail VARCHAR(255));
Exemplo 3
create table Tabela3 ( personid int(50) not null auto_increment primary key, firstname varchar(35), middlename varchar(50), lastname varchar(50) default 'bato');
Modifique o script de inicializao (/etc/rc.d/rc.mysql) para permitir conexes de rede comentando o "SKIP="--skipnetworking"":
# To allow outside connections to the database comment out the next line. # If you don't need incoming network connections, then leave the line # uncommented to improve system security. ##SKIP="--skip-networking
Outras informaes:
http://www.pantz.org/software/mysql/mysqlcommands.html
Formula rio
banco.html
<html> <head> <title>Formulrio de Cadastro</title> </head> <body> <H1>Formulrio de Cadastro</h1> <form action="banco.php" method="get"> <table border="0"> <TR><td>Nome:</td> <td><input type="text" name="nome" maxlength="100" size="100"></td></tr> <TR><td>Idade:</td> <td><input type="text" name="idade" maxlength="3" size="3"></td></tr> </table> <input type="submit" value="CADASTRAR"> </form> </body> </html>