sábado, 3 de septiembre de 2016

mysql null values

SELECT COUNT( * )
FROM  `list`
WHERE list_name =  "818 5k"
AND call_dispo IS NULL

UPDATE  `list` SET  `call_status` =  "pending" WHERE list_name =  "818 5k" AND call_dispo IS NULL

miércoles, 3 de agosto de 2016

20 MySQL (Mysqladmin) Commands for Database Administration in Linux

20 MySQL (Mysqladmin) Commands for Database Administration in Linux

lunes, 4 de julio de 2016

creating user on mysql

CREATE USER 'freepbxuser'@'localhost' IDENTIFIED BY '2366';




SET PASSWORD FOR 'freepbxuser'@'localhost' = PASSWORD('Linux456');




GRANT ALL PRIVILEGES ON asterisk.* TO freepbxuser@localhost IDENTIFIED BY 'Linux456';


dandole permiso a todas las tables

CREATE USER 'admin'@'localhost' IDENTIFIED BY '2366';

mysql> GRANT ALL PRIVILEGES ON *.*  TO admin@localhost IDENTIFIED BY '012130';


grant   to login from any IP

GRANT ALL PRIVILEGES ON *.*  TO admin@'%' IDENTIFIED BY '7812333';

-------------------------------------------------------------

mysql 8
mysql> CREATE USER 'phpmyadmin'@'%' IDENTIFIED BY '9YB11111';
GRANT ALL ON *.* TO 'phpmyadmin'@'%';
FLUSH PRIVILEGES;


USE mysql;
CREATE USER 'user'@'localhost' IDENTIFIED BY 'P@ssW0rd';
GRANT ALL ON *.* TO 'user'@'localhost';
FLUSH PRIVILEGES;

domingo, 5 de junio de 2016

Comparison Functions and Operators



Table 13.3 Comparison Operators
NameDescription
BETWEEN ... AND ...Check whether a value is within a range of values
COALESCE()Return the first non-NULL argument
=Equal operator
<=>NULL-safe equal to operator
>Greater than operator
>=Greater than or equal operator
GREATEST()Return the largest argument
IN()Check whether a value is within a set of values
INTERVAL()Return the index of the argument that is less than the first argument
ISTest a value against a boolean
IS NOTTest a value against a boolean
IS NOT NULLNOT NULL value test
IS NULLNULL value test
ISNULL()Test whether the argument is NULL
LEAST()Return the smallest argument
<Less than operator
<=Less than or equal operator
LIKESimple pattern matching
NOT BETWEEN ... AND ...Check whether a value is not within a range of values
!=<>Not equal operator
NOT IN()Check whether a value is not within a set of values
NOT LIKENegation of simple pattern matching
STRCMP()Compare two strings
SELECT * FROM tbl_name WHERE date_column IS NULL

http://dev.mysql.com/doc/refman/5.7/en/comparison-operators.html#operator_is-null