If the password for the mysql “root” user is lost, it’s still possible reset it to some other value. The restart of the mySQL server will be necessary, of course.
The following should be done:
Stop the server It could be done normally:
/etc/init.d/mysql stop
or effectively:
ps -ef | grep mysql … mysql 25079 [...]
news and informations automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel
Here are some examples how to use “rownum” functionality (similar to Oracle) in mysql
UPDATE mytable SET col1 = ‘somevalue’ ORDER BY col2 LIMIT 300
rownum analog:
SELECT @rownum:=@rownum+1 rownum, mytable.* FROM (SELECT @rownum:=0) r, mytable;
news and informations automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel
SELECT table_schema "Database", SUM( data_length + index_length ) / 1024 / 1024 "Size (MB)", SUM( data_free )/ 1024 / 1024 "Free (MB)" FROM information_schema.TABLES GROUP BY table_schema ;
This will work in mySQL 5.0.2 and newer. Use SHOW TABLE STATUS command for other versions.
news and informations automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel
The following code starts the SQL from the shell script directly, without additional SQL file
#!/bin/sh –/. &> /dev/null; exec mysql "$@" select ‘Hello, world!’ as test ;
The detailed explanation of the trick is here
news and informations automotive,business,crime,health,life,politics,science,technology,travelautomotive,business,crime,health,life,politics,science,technology,travel
|
|