Después de ingresar este comando aparecerá un campo donde deberás ingresar la clave.
maximi89@debian:~/mesa$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 312
Server version: 5.1.58-1 (Debian)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>
Dentro de este, podrás ejecutar todos los comandos que deseas:
create database nombre;
use nombrebasededatos;
create table nombre;
CREATE TABLE ejemplo( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), nombre VARCHAR(30), edad INT);
delete from tabla where campo=valor;
TRUNCATE TABLE nombretabla; (REFIÉRASE ENLACE 2)
drop database nombre;
drop table nombre;
alter table nombretabla add (campo tipo, campo tipo);
alter table empresa change fotos fotos longblob;
alter table empresa modify fotos longblob;
alter table nombretabla [función a usar]; (véase http://dev.mysql.com/doc/refman/5.0/es/alter-table.html )
UPDATE tabla SET campo = ‘valor’, campo2 = ‘valor2’ WHERE condicion;
UPDATE table SET campo=valornuevo WHERE campo1=valor1 AND campo2=valor2;
select * from tabla;
show databases;
show tables;
insert into TABLA values (‘primercampo’,’segundocampo’); ( http://www.w3schools.com/SQL/sql_insert.asp )
insert into table tabla_linux values(valor1,valor2);
Desde PHP:
$conectar = mysql_connect(“localhost”,”root”,”claveDB”) or die (mysql_error());
mysql_select_db(‘linux’) or die (mysql_error());
$consulta (“insert into table tabla_linux values(0,’$nombre’,’$apellido’,’$rut’,’$nac’,’$ciudad’);”);
$resultado = mysql_query($consulta,$conectar) or die (mysql_error());
para pasar los datos desde la BD a Navegador usar
mysql_fetch_array();
—————————————————————-
Fuente: http://www.w3schools.com/php/php_mysql_update.asp
http://www.electrictoolbox.com/article/mysql/delete-all-data-mysql/