When you are using "-cp" switch the "CLASSPATH" environment variable will be ignored, to use the values contained within that you should add that to the "-cp" switch as well. java -cp $CLASSAPTH;. MysqlConnect
P.S:I'm not sure about the delimiter (i.e ; or :).
This should include the directory your class resides as well (this case I think current directory?). Try "java -cp $CLASSPATH;. MysqlConnect" OR "java -cp $CLASSPATH:. MysqlConnect"